Did I find the right examples for you? yes no

All Samples(8067)  |  Call(6186)  |  Derive(1)  |  Import(1880)
Represent a table in a database.

e.g.::

    mytable = Table("mytable", metadata,
                    Column('mytable_id', Integer, primary_key=True),
                    Column('value', String(50))
               )

The :class:`.Table` object constructs a unique instance of itself based
on its name and optional schema name within the given
:class:`.MetaData` object. Calling the :class:`.Table`
constructor with the same name and same :class:`.MetaData` argument
a second time will return the *same* :class:`.Table` object - in this way
the :class:`.Table` constructor acts as a registry function.

.. seealso::

    :ref:`metadata_describing` - Introduction to database metadata

Constructor arguments are as follows:

:param name: The name of this table as represented in the database.

    The table name, along with the value of the ``schema`` parameter,
    forms a key which uniquely identifies this :class:`.Table` within
    the owning :class:`.MetaData` collection.
    Additional calls to :class:`.Table` with the same name, metadata,
    and schema name will return the same :class:`.Table` object.

    Names which contain no upper case characters
    will be treated as case insensitive names, and will not be quoted
    unless they are a reserved word or contain special characters.
    A name with any number of upper case characters is considered
    to be case sensitive, and will be sent as quoted.

    To enable unconditional quoting for the table name, specify the flag
    ``quote=True`` to the constructor, or use the :class:`.quoted_name`
    construct to specify the name.

:param metadata: a :class:`.MetaData` object which will contain this
    table.  The metadata is used as a point of association of this table
    with other tables which are referenced via foreign key.  It also
    may be used to associate this table with a particular
    :class:`.Connectable`.

:param \*args: Additional positional arguments are used primarily
    to add the list of :class:`.Column` objects contained within this
    table. Similar to the style of a CREATE TABLE statement, other
    :class:`.SchemaItem` constructs may be added here, including
    :class:`.PrimaryKeyConstraint`, and :class:`.ForeignKeyConstraint`.

:param autoload: Defaults to False: the Columns for this table should
    be reflected from the database. Usually there will be no Column
    objects in the constructor if this property is set.

:param autoload_replace: If ``True``, when using ``autoload=True``
    and ``extend_existing=True``,
    replace ``Column`` objects already present in the ``Table`` that's
    in the ``MetaData`` registry with
    what's reflected.  Otherwise, all existing columns will be
    excluded from the reflection process.    Note that this does
    not impact ``Column`` objects specified in the same call to ``Table``
    which includes ``autoload``, those always take precedence.
    Defaults to ``True``.

    .. versionadded:: 0.7.5

:param autoload_with: If autoload==True, this is an optional Engine
    or Connection instance to be used for the table reflection. If
    ``None``, the underlying MetaData's bound connectable will be used.

:param extend_existing: When ``True``, indicates that if this
    :class:`.Table` is already present in the given :class:`.MetaData`,
    apply further arguments within the constructor to the existing
    :class:`.Table`.

    If ``extend_existing`` or ``keep_existing`` are not set, an error is
    raised if additional table modifiers are specified when
    the given :class:`.Table` is already present in the :class:`.MetaData`.

    .. versionchanged:: 0.7.4
        ``extend_existing`` will work in conjunction
        with ``autoload=True`` to run a new reflection operation against
        the database; new :class:`.Column` objects will be produced
        from database metadata to replace those existing with the same
        name, and additional :class:`.Column` objects not present
        in the :class:`.Table` will be added.

    As is always the case with ``autoload=True``, :class:`.Column`
    objects can be specified in the same :class:`.Table` constructor,
    which will take precedence.  I.e.::

        Table("mytable", metadata,
                    Column('y', Integer),
                    extend_existing=True,
                    autoload=True,
                    autoload_with=engine
                )

    The above will overwrite all columns within ``mytable`` which
    are present in the database, except for ``y`` which will be used as is
    from the above definition.   If the ``autoload_replace`` flag
    is set to False, no existing columns will be replaced.

:param implicit_returning: True by default - indicates that
    RETURNING can be used by default to fetch newly inserted primary key
    values, for backends which support this.  Note that
    create_engine() also provides an implicit_returning flag.

:param include_columns: A list of strings indicating a subset of
    columns to be loaded via the ``autoload`` operation; table columns who
    aren't present in this list will not be represented on the resulting
    ``Table`` object. Defaults to ``None`` which indicates all columns
    should be reflected.

:param info: Optional data dictionary which will be populated into the
    :attr:`.SchemaItem.info` attribute of this object.

:param keep_existing: When ``True``, indicates that if this Table
    is already present in the given :class:`.MetaData`, ignore
    further arguments within the constructor to the existing
    :class:`.Table`, and return the :class:`.Table` object as
    originally created. This is to allow a function that wishes
    to define a new :class:`.Table` on first call, but on
    subsequent calls will return the same :class:`.Table`,
    without any of the declarations (particularly constraints)
    being applied a second time. Also see extend_existing.

    If extend_existing or keep_existing are not set, an error is
    raised if additional table modifiers are specified when
    the given :class:`.Table` is already present in the :class:`.MetaData`.

:param listeners: A list of tuples of the form ``(<eventname>, <fn>)``
    which will be passed to :func:`.event.listen` upon construction.
    This alternate hook to :func:`.event.listen` allows the establishment
    of a listener function specific to this :class:`.Table` before
    the "autoload" process begins.  Particularly useful for
    the :meth:`.DDLEvents.column_reflect` event::

        def listen_for_reflect(table, column_info):
            "handle the column reflection event"
            # ...

        t = Table(
            'sometable',
            autoload=True,
            listeners=[
                ('column_reflect', listen_for_reflect)
            ])

:param mustexist: When ``True``, indicates that this Table must already
    be present in the given :class:`.MetaData` collection, else
    an exception is raised.

:param prefixes:
    A list of strings to insert after CREATE in the CREATE TABLE
    statement.  They will be separated by spaces.

:param quote: Force quoting of this table's name on or off, corresponding
    to ``True`` or ``False``.  When left at its default of ``None``,
    the column identifier will be quoted according to whether the name is
    case sensitive (identifiers with at least one upper case character are
    treated as case sensitive), or if it's a reserved word.  This flag
    is only needed to force quoting of a reserved word which is not known
    by the SQLAlchemy dialect.

:param quote_schema: same as 'quote' but applies to the schema identifier.

:param schema: The schema name for this table, which is required if
    the table resides in a schema other than the default selected schema
    for the engine's database connection.  Defaults to ``None``.

    The quoting rules for the schema name are the same as those for the
    ``name`` parameter, in that quoting is applied for reserved words or
    case-sensitive names; to enable unconditional quoting for the
    schema name, specify the flag
    ``quote_schema=True`` to the constructor, or use the :class:`.quoted_name`
    construct to specify the name.


:param useexisting: Deprecated.  Use extend_existing.

src/f/p/fpdb-grindi-HEAD/pyfpdb/AlchemyTables.py   fpdb-grindi(Download)
#TODO: gettextify if file is used again
 
from sqlalchemy import Table, Float, Column, Integer, String, MetaData, \
        ForeignKey, Boolean, SmallInteger, DateTime, Text, Index, CHAR, \
        PickleType, Unicode
 
 
autorates_table = Table('Autorates', metadata,
    Column('id',             Integer, primary_key=True, nullable=False),
    Column('playerId',       Integer, ForeignKey("Players.id"), nullable=False), 
 
 
gametypes_table = Table('Gametypes', metadata,
    Column('id',            SmallInteger, primary_key=True),
    Column('siteId',        SmallInteger, ForeignKey("Sites.id"), nullable=False), # SMALLINT
 
 
hands_table = Table('Hands', metadata,
    Column('id',            BigIntColumn, primary_key=True),
    Column('tableName',     String(30), nullable=False),
 
 
hands_actions_table = Table('HandsActions', metadata,
    Column('id',            BigIntColumn, primary_key=True, nullable=False),
    Column('handId',        BigIntColumn, ForeignKey("Hands.id"), nullable=False),

src/f/p/fpdb-sql-HEAD/pyfpdb/AlchemyTables.py   fpdb-sql(Download)
#TODO: gettextify if file is used again
 
from sqlalchemy import Table, Float, Column, Integer, String, MetaData, \
        ForeignKey, Boolean, SmallInteger, DateTime, Text, Index, CHAR, \
        PickleType, Unicode
 
 
autorates_table = Table('Autorates', metadata,
    Column('id',             Integer, primary_key=True, nullable=False),
    Column('playerId',       Integer, ForeignKey("Players.id"), nullable=False), 
 
 
gametypes_table = Table('Gametypes', metadata,
    Column('id',            SmallInteger, primary_key=True),
    Column('siteId',        SmallInteger, ForeignKey("Sites.id"), nullable=False), # SMALLINT
 
 
hands_table = Table('Hands', metadata,
    Column('id',            BigIntColumn, primary_key=True),
    Column('tableName',     String(30), nullable=False),
 
 
hands_actions_table = Table('HandsActions', metadata,
    Column('id',            BigIntColumn, primary_key=True, nullable=False),
    Column('handId',        BigIntColumn, ForeignKey("Hands.id"), nullable=False),

src/s/y/synthesis-1.1061/synthesis/dbobjects.py   synthesis(Download)
#!/usr/bin/env python
 
from sqlalchemy import create_engine, Table, Column, Integer, String, Boolean, MetaData, ForeignKey
from sqlalchemy.orm import sessionmaker, mapper, relation, clear_mappers
from sqlalchemy.types import DateTime, Date
    def system_configuration_map(self):
        table_metadata = MetaData(bind=self.pg_db_engine)
        #table_metadata = MetaData(bind=self.sqlite_db)
        system_configuration_table = Table(
        'sender_system_configuration', 
    def service_event_map(self):
        table_metadata = MetaData(bind=self.pg_db_engine)
        service_event_table = Table(
        'service_event',
        table_metadata,
    def need_map(self):
        table_metadata = MetaData(bind=self.pg_db_engine)
        need_table = Table(
        'need',
        table_metadata,
    def site_service_participation_map(self):
        table_metadata = MetaData(bind=self.pg_db_engine)
        site_service_participation_table = Table(
        'site_service_participation',
        table_metadata,

src/n/o/nova-HEAD/nova/db/sqlalchemy/migrate_repo/versions/216_havana.py   nova(Download)
from sqlalchemy import Boolean, BigInteger, Column, DateTime, Enum, Float
from sqlalchemy import dialects
from sqlalchemy import ForeignKey, Index, Integer, MetaData, String, Table
from sqlalchemy import Text
from sqlalchemy.types import NullType
 
    for table_name in table_names:
        table = Table(table_name, meta, autoload=True)
 
        columns = []
 
        shadow_table_name = 'shadow_' + table_name
        shadow_table = Table(shadow_table_name, meta, *columns,
                             mysql_engine='InnoDB')
        try:
                   'instance_actions_events', 'instance_faults', 'migrations']
    for table_name in table_names:
        table = Table(table_name, meta, autoload=True)
 
        dump_table_name = 'dump_' + table.name
            else:
                columns.append(column.copy())
        table_dump = Table(dump_table_name, meta, *columns,
                           mysql_engine='InnoDB')
        table_dump.create()

src/l/u/LuoYunCloud-HEAD/lyweb/lib/SQLAlchemy-0.8.2/examples/large_collection/large_collection.py   LuoYunCloud(Download)
 
from sqlalchemy import (MetaData, Table, Column, Integer, String, ForeignKey,
                        create_engine)
from sqlalchemy.orm import (mapper, relationship, sessionmaker)
 
 
meta = MetaData()
 
org_table = Table('organizations', meta,
    mysql_engine='InnoDB')
 
member_table = Table('members', meta,
    Column('member_id', Integer, primary_key=True),
    Column('member_name', String(50), nullable=False, key='name'),

src/s/q/SQLAlchemy-0.9.4/examples/large_collection/large_collection.py   SQLAlchemy(Download)
 
from sqlalchemy import (MetaData, Table, Column, Integer, String, ForeignKey,
                        create_engine)
from sqlalchemy.orm import (mapper, relationship, sessionmaker)
 
 
meta = MetaData()
 
org_table = Table('organizations', meta,
    mysql_engine='InnoDB')
 
member_table = Table('members', meta,
    Column('member_id', Integer, primary_key=True),
    Column('member_name', String(50), nullable=False, key='name'),

src/k/i/kitsune-HEAD/vendor/packages/sqlalchemy/examples/large_collection/large_collection.py   kitsune(Download)
 
from sqlalchemy import (MetaData, Table, Column, Integer, String, ForeignKey,
                        create_engine)
from sqlalchemy.orm import (mapper, relationship, sessionmaker)
 
 
meta = MetaData()
 
org_table = Table('organizations', meta, 
    mysql_engine='InnoDB')
 
member_table = Table('members', meta,
    Column('member_id', Integer, primary_key=True),
    Column('member_name', String(50), nullable=False, key='name'),

src/l/u/LuoYunCloud-HEAD/lyweb/lib/SQLAlchemy-0.8.2/examples/vertical/dictlike-polymorphic.py   LuoYunCloud(Download)
 
if __name__ == '__main__':
    from sqlalchemy import (MetaData, Table, Column, Integer, Unicode,
        ForeignKey, UnicodeText, and_, not_, or_, String, Boolean, cast, text,
        null, case, create_engine)
    metadata = MetaData()
 
    animals = Table('animal', metadata,
                    Column('id', Integer, primary_key=True),
                    Column('name', Unicode(100)))
 
    chars = Table('facts', metadata,

src/k/u/kuma-lib-HEAD/packages/sqlalchemy/examples/large_collection/large_collection.py   kuma-lib(Download)
 
from sqlalchemy import (MetaData, Table, Column, Integer, String, ForeignKey,
                        create_engine)
from sqlalchemy.orm import (mapper, relationship, sessionmaker)
 
 
meta = MetaData()
 
org_table = Table('organizations', meta, 
    mysql_engine='InnoDB')
 
member_table = Table('members', meta,
    Column('member_id', Integer, primary_key=True),
    Column('member_name', String(50), nullable=False, key='name'),

src/i/n/input-lib-HEAD/packages/sqlalchemy/examples/large_collection/large_collection.py   input-lib(Download)
 
from sqlalchemy import (MetaData, Table, Column, Integer, String, ForeignKey,
                        create_engine)
from sqlalchemy.orm import (mapper, relationship, sessionmaker)
 
 
meta = MetaData()
 
org_table = Table('organizations', meta, 
    mysql_engine='InnoDB')
 
member_table = Table('members', meta,
    Column('member_id', Integer, primary_key=True),
    Column('member_name', String(50), nullable=False, key='name'),

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next