<%namespace name="formatting" file="formatting.html"/>
<%namespace name="nav" file="nav.html"/>
<%namespace name="pydoc" file="pydoc.html"/>
-<%def name="title()">SQLAlchemy 0.3 Documentation - Modules and Classes</%def>
+<%def name="title()">SQLAlchemy 0.4 Documentation - Modules and Classes</%def>
<%!
filename = 'docstrings'
import re
from sqlalchemy import schema, types, ansisql, engine, sql, pool, orm, exceptions, databases
+import sqlalchemy.orm.shard
import sqlalchemy.ext.sessioncontext as sessioncontext
import sqlalchemy.ext.selectresults as selectresults
import sqlalchemy.ext.orderinglist as orderinglist
import sqlalchemy.ext.associationproxy as associationproxy
+import sqlalchemy.ext.assignmapper as assignmapper
+import sqlalchemy.ext.sqlsoup as sqlsoup
def make_doc(obj, classes=None, functions=None, **kwargs):
"""generate a docstring.ObjectDoc structure for an individual module, list of classes, and list of functions."""
objects = [
make_doc(obj=sql,include_all_classes=True),
make_doc(obj=schema),
+ make_doc(obj=pool),
make_doc(obj=types),
make_doc(obj=engine),
make_doc(obj=engine.url),
make_doc(obj=engine.threadlocal),
make_doc(obj=ansisql),
make_doc(obj=orm),
- make_doc(obj=orm.mapperlib, classes=[orm.mapperlib.MapperExtension, orm.mapperlib.Mapper]),
- make_doc(obj=orm.interfaces),
make_doc(obj=orm.collections, classes=[orm.collections.collection,
orm.collections.MappedCollection,
orm.collections.CollectionAdapter]),
+ make_doc(obj=orm.interfaces),
+ make_doc(obj=orm.mapperlib, classes=[orm.mapperlib.MapperExtension, orm.mapperlib.Mapper]),
+ make_doc(obj=orm.properties),
make_doc(obj=orm.query, classes=[orm.query.Query, orm.query.QueryContext, orm.query.SelectionContext]),
make_doc(obj=orm.session, classes=[orm.session.Session, orm.session.SessionTransaction]),
+ make_doc(obj=orm.shard),
make_doc(obj=exceptions),
- make_doc(obj=pool),
- make_doc(obj=sessioncontext),
- make_doc(obj=selectresults),
- make_doc(obj=orderinglist, classes=[orderinglist.OrderingList]),
+ make_doc(obj=assignmapper),
make_doc(obj=associationproxy, classes=[associationproxy.AssociationProxy]),
+ make_doc(obj=orderinglist, classes=[orderinglist.OrderingList]),
+ make_doc(obj=sessioncontext),
+ make_doc(obj=sqlsoup),
] + [make_doc(getattr(__import__('sqlalchemy.databases.%s' % m).databases, m)) for m in databases.__all__]
return objects
import StringIO, sys, re, random
-class Dialect(sql.AbstractDialect):
+class Dialect(object):
"""Define the behavior of a specific database/DBAPI.
Any aspect of metadata definition, SQL query generation, execution,
secondary
for a many-to-many relationship, specifies the intermediary table. The
- `secondary` keyword argument should generally only be used for a table
+ ``secondary`` keyword argument should generally only be used for a table
that is not otherwise expressed in any class mapping. In particular,
using the Association Object Pattern is
- generally mutually exclusive against using the `secondary` keyword
+ generally mutually exclusive against using the ``secondary`` keyword
argument.
\**kwargs follow:
relationship. SA can now automatically reconcile a "delete" and
"insert" operation of two objects with the same "identity" in a flush()
operation into a single "update" statement, which is the pattern that
- "association" used to indicate. See the updated example of association
- mappings in [datamapping_association](rel:datamapping_association).
+ "association" used to indicate.
backref
indicates the name of a property to be placed on the related mapper's
class that will handle this relationship in the other direction,
including synchronizing the object attributes on both sides of the
- relation. Can also point to a `backref()` construct for more
+ relation. Can also point to a ``backref()`` construct for more
configurability.
cascade
foreign_keys
a list of columns which are to be used as "foreign key" columns.
this parameter should be used in conjunction with explicit
- `primaryjoin` and `secondaryjoin` (if needed) arguments, and the
- columns within the `foreign_keys` list should be present within
- those join conditions. Normally, `relation()` will inspect the
+ ``primaryjoin`` and ``secondaryjoin`` (if needed) arguments, and the
+ columns within the ``foreign_keys`` list should be present within
+ those join conditions. Normally, ``relation()`` will inspect the
columns within the join conditions to determine which columns are
- the "foreign key" columns, based on information in the `Table`
+ the "foreign key" columns, based on information in the ``Table``
metadata. Use this argument when no ForeignKey's are present in the
join condition, or to override the table-defined foreign keys.
foreignkey
- deprecated. use the `foreign_keys` argument for foreign key
- specification, or `remote_side` for "directional" logic.
+ deprecated. use the ``foreign_keys`` argument for foreign key
+ specification, or ``remote_side`` for "directional" logic.
lazy=True
specifies how the related items should be loaded. a value of True
indicates the ordering that should be applied when loading these items.
passive_deletes=False
- Indicates if lazy-loaders should not be executed during the `flush()`
+ Indicates if lazy-loaders should not be executed during the ``flush()``
process, which normally occurs in order to locate all existing child
items when a parent item is to be deleted. Setting this flag to True is
- appropriate when `ON DELETE CASCADE` rules have been set up on the
+ appropriate when ``ON DELETE CASCADE`` rules have been set up on the
actual tables so that the database may handle cascading deletes
automatically. This strategy is useful particularly for handling the
deletion of objects that have very large (and/or deep) child-object
that are dependent on each other, such as a table that has a
one-to-many relationship to a set of child rows, and also has a column
that references a single child row within that list (i.e. both tables
- contain a foreign key to each other). If a `flush()` operation returns
+ contain a foreign key to each other). If a ``flush()`` operation returns
an error that a "cyclical dependency" was detected, this is a cue that
- you might want to use `post_update` to "break" the cycle.
+ you might want to use ``post_update`` to "break" the cycle.
primaryjoin
a ClauseElement that will be used as the primary join of this child
and child tables (or association table).
private=False
- deprecated. setting `private=True` is the equivalent of setting
- `cascade="all, delete-orphan"`, and indicates the lifecycle of child
+ deprecated. setting ``private=True`` is the equivalent of setting
+ ``cascade="all, delete-orphan"``, and indicates the lifecycle of child
objects should be contained within that of the parent.
remote_side
uselist=(True|False)
a boolean that indicates if this property should be loaded as a list or
a scalar. In most cases, this value is determined automatically by
- `relation()`, based on the type and direction of the relationship - one
+ ``relation()``, based on the type and direction of the relationship - one
to many forms a list, many to one forms a scalar, many to many is a
list. If a scalar is desired where normally a list would be present,
such as a bi-directional one-to-one relationship, set uselist to False.
columns given, as well as a __colset__() method which returns its attributes
in column order.
- class_
+ class\_
the "composite type" class.
\*cols
The name of this column. This should be the identical name
as it appears, or will appear, in the database.
- type_
+ type\_
The ``TypeEngine`` for this column. This can be any
subclass of ``types.AbstractType``, including the
database-agnostic types defined in the types module,
from sqlalchemy import types as sqltypes
import re, operator
-__all__ = ['AbstractDialect', 'Alias', 'ClauseElement', 'ClauseParameters',
+__all__ = ['Alias', 'ClauseElement', 'ClauseParameters',
'ClauseVisitor', 'ColumnCollection', 'ColumnElement',
'CompoundSelect', 'Delete', 'FromClause', 'Insert', 'Join',
'Select', 'Selectable', 'TableClause', 'Update', 'alias', 'and_', 'asc',
the underlying DBAPI, or is translatable via the given type
argument.
- type
+ type\_
an optional [sqlalchemy.types#TypeEngine] which will provide
bind-parameter translation for this literal.
constructs that are not to be quoted, use the [sqlalchemy.sql#literal_column()]
function.
- type
+ type\_
an optional [sqlalchemy.types#TypeEngine] object which will provide
result-set translation for this column.
def is_column(col):
return isinstance(col, ColumnElement)
-class AbstractDialect(object):
- """Represent the behavior of a particular database.
-
- Used by ``Compiled`` objects."""
- pass
-
class ClauseParameters(object):
"""Represent a dictionary/iterator of bind parameter key names/values.
execution may match either the key or the shortname of the
corresponding ``_BindParamClause`` objects.
- type_
+ type\_
A ``TypeEngine`` object that will be used to pre-process the
value corresponding to this ``_BindParamClause`` at
execution time.