diff options
Diffstat (limited to 'lib/sqlalchemy')
39 files changed, 101 insertions, 101 deletions
diff --git a/lib/sqlalchemy/dialects/mssql/base.py b/lib/sqlalchemy/dialects/mssql/base.py index 051efa719..2f94d61ea 100644 --- a/lib/sqlalchemy/dialects/mssql/base.py +++ b/lib/sqlalchemy/dialects/mssql/base.py @@ -425,7 +425,7 @@ Compatibility Levels -------------------- MSSQL supports the notion of setting compatibility levels at the database level. This allows, for instance, to run a database that -is compatible with SQL2000 while running on a SQL2005 database +is compatible with SQL2000 while running on an SQL2005 database server. ``server_version_info`` will always return the database server version information (in this case SQL2005) and not the compatibility level information. Because of this, if running under diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index eb3449e40..6c1909e1d 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -901,7 +901,7 @@ class ENUM(sqltypes.Enum): or :meth:`~.postgresql.ENUM.drop` are called directly. Setting to ``False`` is helpful - when invoking a creation scheme to a SQL file + when invoking a creation scheme to an SQL file without access to the actual database - the :meth:`~.postgresql.ENUM.create` and :meth:`~.postgresql.ENUM.drop` methods can diff --git a/lib/sqlalchemy/dialects/postgresql/hstore.py b/lib/sqlalchemy/dialects/postgresql/hstore.py index 67923fe39..ca8cffcd2 100644 --- a/lib/sqlalchemy/dialects/postgresql/hstore.py +++ b/lib/sqlalchemy/dialects/postgresql/hstore.py @@ -137,7 +137,7 @@ class HSTORE(sqltypes.Indexable, sqltypes.Concatenable, sqltypes.TypeEngine): def has_key(self, other): """Boolean expression. Test for presence of a key. Note that the - key may be a SQLA expression. + key may be an SQLA expression. """ return self.operate(HAS_KEY, other, result_type=sqltypes.Boolean) @@ -169,13 +169,13 @@ class HSTORE(sqltypes.Indexable, sqltypes.Concatenable, sqltypes.TypeEngine): def defined(self, key): """Boolean expression. Test for presence of a non-NULL value for - the key. Note that the key may be a SQLA expression. + the key. Note that the key may be an SQLA expression. """ return _HStoreDefinedFunction(self.expr, key) def delete(self, key): """HStore expression. Returns the contents of this hstore with the - given key deleted. Note that the key may be a SQLA expression. + given key deleted. Note that the key may be an SQLA expression. """ if isinstance(key, dict): key = _serialize_hstore(key) @@ -246,7 +246,7 @@ ischema_names['hstore'] = HSTORE class hstore(sqlfunc.GenericFunction): - """Construct an hstore value within a SQL expression using the + """Construct an hstore value within an SQL expression using the Postgresql ``hstore()`` function. The :class:`.hstore` function accepts one or two arguments as described diff --git a/lib/sqlalchemy/dialects/postgresql/json.py b/lib/sqlalchemy/dialects/postgresql/json.py index b0f0f7cf0..1791b49d5 100644 --- a/lib/sqlalchemy/dialects/postgresql/json.py +++ b/lib/sqlalchemy/dialects/postgresql/json.py @@ -242,7 +242,7 @@ class JSONB(JSON): def has_key(self, other): """Boolean expression. Test for presence of a key. Note that the - key may be a SQLA expression. + key may be an SQLA expression. """ return self.operate(HAS_KEY, other, result_type=sqltypes.Boolean) diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg2.py b/lib/sqlalchemy/dialects/postgresql/psycopg2.py index fe245b21d..046aa22a8 100644 --- a/lib/sqlalchemy/dialects/postgresql/psycopg2.py +++ b/lib/sqlalchemy/dialects/postgresql/psycopg2.py @@ -188,7 +188,7 @@ one of these characters in its name. One is to specify the ) Above, an INSERT statement such as ``measurement.insert()`` will use -``size_meters`` as the parameter name, and a SQL expression such as +``size_meters`` as the parameter name, and an SQL expression such as ``measurement.c.size_meters > 10`` will derive the bound parameter name from the ``size_meters`` key as well. diff --git a/lib/sqlalchemy/dialects/sqlite/base.py b/lib/sqlalchemy/dialects/sqlite/base.py index ddd869448..63f2d896f 100644 --- a/lib/sqlalchemy/dialects/sqlite/base.py +++ b/lib/sqlalchemy/dialects/sqlite/base.py @@ -16,7 +16,7 @@ Date and Time Types SQLite does not have built-in DATE, TIME, or DATETIME types, and pysqlite does not provide out of the box functionality for translating values between Python -`datetime` objects and a SQLite-supported format. SQLAlchemy's own +`datetime` objects and an SQLite-supported format. SQLAlchemy's own :class:`~sqlalchemy.types.DateTime` and related types provide date formatting and parsing functionality when SQlite is used. The implementation classes are :class:`~.sqlite.DATETIME`, :class:`~.sqlite.DATE` and :class:`~.sqlite.TIME`. @@ -153,7 +153,7 @@ with an error. This behavior becomes more critical when used in conjunction with the SQLAlchemy ORM. SQLAlchemy's :class:`.Session` object by default runs within a transaction, and with its autoflush model, may emit DML preceding -any SELECT statement. This may lead to a SQLite database that locks +any SELECT statement. This may lead to an SQLite database that locks more quickly than is expected. The locking mode of SQLite and the pysqlite driver can be manipulated to some degree, however it should be noted that achieving a high degree of write-concurrency with SQLite is a losing battle. diff --git a/lib/sqlalchemy/dialects/sqlite/pysqlite.py b/lib/sqlalchemy/dialects/sqlite/pysqlite.py index 33d04deeb..9db4cebdf 100644 --- a/lib/sqlalchemy/dialects/sqlite/pysqlite.py +++ b/lib/sqlalchemy/dialects/sqlite/pysqlite.py @@ -37,7 +37,7 @@ Connect Strings --------------- The file specification for the SQLite database is taken as the "database" -portion of the URL. Note that the format of a SQLAlchemy url is:: +portion of the URL. Note that the format of an SQLAlchemy url is:: driver://user:pass@host/database diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index 859819a34..646f26497 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -365,7 +365,7 @@ class Connection(Connectable): actual level on the underlying DBAPI connection regardless of how this state was set. Compare to the :attr:`.Connection.default_isolation_level` accessor - which returns the dialect-level setting without performing a SQL + which returns the dialect-level setting without performing an SQL query. .. versionadded:: 0.9.9 @@ -877,7 +877,7 @@ class Connection(Connectable): return self.execute(object, *multiparams, **params).scalar() def execute(self, object, *multiparams, **params): - """Executes the a SQL statement construct and returns a + """Executes the SQL statement construct and returns a :class:`.ResultProxy`. :param object: The statement to be executed. May be diff --git a/lib/sqlalchemy/engine/interfaces.py b/lib/sqlalchemy/engine/interfaces.py index 26731f9a5..45f73a407 100644 --- a/lib/sqlalchemy/engine/interfaces.py +++ b/lib/sqlalchemy/engine/interfaces.py @@ -197,7 +197,7 @@ class Dialect(object): Allows dialects to configure options based on server version info or other properties. - The connection passed here is a SQLAlchemy Connection object, + The connection passed here is an SQLAlchemy Connection object, with full capabilities. The initialize() method of the base dialect should be called via diff --git a/lib/sqlalchemy/engine/result.py b/lib/sqlalchemy/engine/result.py index 0333d9ec2..d13c8590b 100644 --- a/lib/sqlalchemy/engine/result.py +++ b/lib/sqlalchemy/engine/result.py @@ -742,7 +742,7 @@ class ResultProxy(object): This is a DBAPI specific method and is only functional for those backends which support it, for statements - where it is appropriate. It's behavior is not + where it is appropriate. Its behavior is not consistent across backends. Usage of this method is normally unnecessary when diff --git a/lib/sqlalchemy/events.py b/lib/sqlalchemy/events.py index c679db37d..2247cf996 100644 --- a/lib/sqlalchemy/events.py +++ b/lib/sqlalchemy/events.py @@ -697,7 +697,7 @@ class ConnectionEvents(event.Events): closing the cursor, rolling back of the transaction in the case of connectionless execution, and disposing of the entire connection pool if a "disconnect" was detected. The - exception is then wrapped in a SQLAlchemy DBAPI exception + exception is then wrapped in an SQLAlchemy DBAPI exception wrapper and re-thrown. :param conn: :class:`.Connection` object diff --git a/lib/sqlalchemy/exc.py b/lib/sqlalchemy/exc.py index 272984229..f9e9ae53f 100644 --- a/lib/sqlalchemy/exc.py +++ b/lib/sqlalchemy/exc.py @@ -198,7 +198,7 @@ UnmappedColumnError = None class StatementError(SQLAlchemyError): - """An error occurred during execution of a SQL statement. + """An error occurred during execution of an SQL statement. :class:`StatementError` wraps the exception raised during execution, and features :attr:`.statement` @@ -265,7 +265,7 @@ class DBAPIError(StatementError): and :attr:`~.StatementError.params` attributes which supply context regarding the specifics of the statement which had an issue, for the typical case when the error was raised within the context of - emitting a SQL statement. + emitting an SQL statement. The wrapped exception object is available in the :attr:`~.StatementError.orig` attribute. Its type and properties are diff --git a/lib/sqlalchemy/ext/associationproxy.py b/lib/sqlalchemy/ext/associationproxy.py index fdc44f386..832680382 100644 --- a/lib/sqlalchemy/ext/associationproxy.py +++ b/lib/sqlalchemy/ext/associationproxy.py @@ -483,7 +483,7 @@ class _AssociationCollection(object): lazy_collection A callable returning a list-based collection of entities (usually an - object attribute managed by a SQLAlchemy relationship()) + object attribute managed by an SQLAlchemy relationship()) creator A function that creates new target entities. Given one parameter: diff --git a/lib/sqlalchemy/ext/compiler.py b/lib/sqlalchemy/ext/compiler.py index 86156be1f..417979927 100644 --- a/lib/sqlalchemy/ext/compiler.py +++ b/lib/sqlalchemy/ext/compiler.py @@ -115,7 +115,7 @@ SQL and DDL constructs are each compiled using different base compilers - ``SQLCompiler`` and ``DDLCompiler``. A common need is to access the compilation rules of SQL expressions from within a DDL expression. The ``DDLCompiler`` includes an accessor ``sql_compiler`` for this reason, such as -below where we generate a CHECK constraint that embeds a SQL expression:: +below where we generate a CHECK constraint that embeds an SQL expression:: @compiles(MyConstraint) def compile_my_constraint(constraint, ddlcompiler, **kw): @@ -252,7 +252,7 @@ A synopsis is as follows: type = TIMESTAMP() * :class:`~sqlalchemy.sql.functions.FunctionElement` - This is a hybrid of a - ``ColumnElement`` and a "from clause" like object, and represents a SQL + ``ColumnElement`` and a "from clause" like object, and represents an SQL function or stored procedure type of call. Since most databases support statements along the line of "SELECT FROM <some function>" ``FunctionElement`` adds in the ability to be used in the FROM clause of a diff --git a/lib/sqlalchemy/ext/horizontal_shard.py b/lib/sqlalchemy/ext/horizontal_shard.py index 996e81fca..b625a2539 100644 --- a/lib/sqlalchemy/ext/horizontal_shard.py +++ b/lib/sqlalchemy/ext/horizontal_shard.py @@ -80,7 +80,7 @@ class ShardedSession(Session): """Construct a ShardedSession. :param shard_chooser: A callable which, passed a Mapper, a mapped - instance, and possibly a SQL clause, returns a shard ID. This id + instance, and possibly an SQL clause, returns a shard ID. This id may be based off of the attributes present within the object, or on some round-robin scheme. If the scheme is based on a selection, it should set whatever state on the instance to mark it in the future as diff --git a/lib/sqlalchemy/ext/hybrid.py b/lib/sqlalchemy/ext/hybrid.py index bbf386742..077df2c02 100644 --- a/lib/sqlalchemy/ext/hybrid.py +++ b/lib/sqlalchemy/ext/hybrid.py @@ -124,7 +124,7 @@ Defining Expression Behavior Distinct from Attribute Behavior Our usage of the ``&`` and ``|`` bitwise operators above was fortunate, considering our functions operated on two boolean values to return a new one. In many cases, the construction of an in-Python -function and a SQLAlchemy SQL expression have enough differences that +function and an SQLAlchemy SQL expression have enough differences that two separate Python expressions should be defined. The :mod:`~sqlalchemy.ext.hybrid` decorators define the :meth:`.hybrid_property.expression` modifier for this purpose. As an @@ -416,7 +416,7 @@ previous ``CaseInsensitiveComparator`` class with a new "Label to apply to Query tuple results" Above, the ``CaseInsensitiveWord`` object represents ``self.word``, -which may be a SQL function, or may be a Python native. By +which may be an SQL function, or may be a Python native. By overriding ``operate()`` and ``__clause_element__()`` to work in terms of ``self.word``, all comparison operations will work against the "converted" form of ``word``, whether it be SQL side or Python side. @@ -765,7 +765,7 @@ class hybrid_property(interfaces.InspectionAttrInfo): return self def expression(self, expr): - """Provide a modifying decorator that defines a SQL-expression + """Provide a modifying decorator that defines an SQL-expression producing method.""" self.expr = expr diff --git a/lib/sqlalchemy/ext/mutable.py b/lib/sqlalchemy/ext/mutable.py index 571bbbda3..258dc4ecf 100644 --- a/lib/sqlalchemy/ext/mutable.py +++ b/lib/sqlalchemy/ext/mutable.py @@ -46,7 +46,7 @@ with any type whose target Python type may be mutable, including :class:`.PickleType`, :class:`.postgresql.ARRAY`, etc. When using the :mod:`sqlalchemy.ext.mutable` extension, the value itself -tracks all parents which reference it. Below, we illustrate the a simple +tracks all parents which reference it. Below, we illustrate a simple version of the :class:`.MutableDict` dictionary object, which applies the :class:`.Mutable` mixin to a plain Python dictionary:: @@ -551,7 +551,7 @@ class Mutable(MutableBase): @classmethod def as_mutable(cls, sqltype): - """Associate a SQL type with this mutable Python type. + """Associate an SQL type with this mutable Python type. This establishes listeners that will detect ORM mappings against the given type, adding mutation event trackers to those mappings. @@ -596,7 +596,7 @@ class Mutable(MutableBase): class MutableComposite(MutableBase): """Mixin that defines transparent propagation of change - events on a SQLAlchemy "composite" object to its + events on an SQLAlchemy "composite" object to its owning parent or parents. See the example in :ref:`mutable_composites` for usage information. diff --git a/lib/sqlalchemy/interfaces.py b/lib/sqlalchemy/interfaces.py index 464ad9f70..b72a15141 100644 --- a/lib/sqlalchemy/interfaces.py +++ b/lib/sqlalchemy/interfaces.py @@ -96,7 +96,7 @@ class PoolListener(object): """Called once for each new DB-API connection or Pool's ``creator()``. dbapi_con - A newly connected raw DB-API connection (not a SQLAlchemy + A newly connected raw DB-API connection (not an SQLAlchemy ``Connection`` wrapper). con_record @@ -108,7 +108,7 @@ class PoolListener(object): """Called exactly once for the first DB-API connection. dbapi_con - A newly connected raw DB-API connection (not a SQLAlchemy + A newly connected raw DB-API connection (not an SQLAlchemy ``Connection`` wrapper). con_record diff --git a/lib/sqlalchemy/orm/descriptor_props.py b/lib/sqlalchemy/orm/descriptor_props.py index 6c87ef9ba..316ef4df4 100644 --- a/lib/sqlalchemy/orm/descriptor_props.py +++ b/lib/sqlalchemy/orm/descriptor_props.py @@ -628,7 +628,7 @@ class ComparableProperty(DescriptorProperty): the :mod:`~sqlalchemy.ext.hybrid` extension. See the example at :ref:`hybrid_custom_comparators`. - Allows any Python descriptor to behave like a SQL-enabled + Allows any Python descriptor to behave like an SQL-enabled attribute when used at the class level in queries, allowing redefinition of expression operator behavior. diff --git a/lib/sqlalchemy/orm/interfaces.py b/lib/sqlalchemy/orm/interfaces.py index faab70e37..8a024b683 100644 --- a/lib/sqlalchemy/orm/interfaces.py +++ b/lib/sqlalchemy/orm/interfaces.py @@ -109,7 +109,7 @@ class MapperProperty(_MappedAttribute, InspectionAttr, util.MemoizedSlots): return {} def setup(self, context, entity, path, adapter, **kwargs): - """Called by Query for the purposes of constructing a SQL statement. + """Called by Query for the purposes of constructing an SQL statement. Each MapperProperty associated with the target mapper processes the statement referenced by the query context, adding columns and/or diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index 2236b2f76..23be6556d 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -266,7 +266,7 @@ class Mapper(InspectionAttr): :ref:`inheritance_toplevel` - :param inherit_condition: For joined table inheritance, a SQL + :param inherit_condition: For joined table inheritance, an SQL expression which will define how the two tables are joined; defaults to a natural join between the two tables. @@ -396,7 +396,7 @@ class Mapper(InspectionAttr): } It may also be specified - as a SQL expression, as in this example where we + as an SQL expression, as in this example where we use the :func:`.case` construct to provide a conditional approach:: @@ -436,7 +436,7 @@ class Mapper(InspectionAttr): } .. versionchanged:: 0.7.4 - ``polymorphic_on`` may be specified as a SQL expression, + ``polymorphic_on`` may be specified as an SQL expression, or refer to any attribute configured with :func:`.column_property`, or to the string name of one. diff --git a/lib/sqlalchemy/orm/properties.py b/lib/sqlalchemy/orm/properties.py index f3dce7541..d4fc03160 100644 --- a/lib/sqlalchemy/orm/properties.py +++ b/lib/sqlalchemy/orm/properties.py @@ -88,7 +88,7 @@ class ColumnProperty(StrategizedProperty): :param expire_on_flush=True: Disable expiry on flush. A column_property() which refers - to a SQL expression (and not a single table-bound column) + to an SQL expression (and not a single table-bound column) is considered to be a "read only" property; populating it has no effect on the state of data, and it can only return database state. For this reason a column_property()'s value diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index 4606c2ffb..11cdc58f2 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -650,7 +650,7 @@ class Query(object): """A readonly attribute which returns the current WHERE criterion for this Query. - This returned value is a SQL expression construct, or ``None`` if no + This returned value is an SQL expression construct, or ``None`` if no criterion has been established. """ @@ -1688,7 +1688,7 @@ class Query(object): ) def join(self, *props, **kwargs): - """Create a SQL JOIN against this :class:`.Query` object's criterion + """Create an SQL JOIN against this :class:`.Query` object's criterion and apply generatively, returning the newly resulting :class:`.Query`. **Simple Relationship Joins** diff --git a/lib/sqlalchemy/orm/relationships.py b/lib/sqlalchemy/orm/relationships.py index 17f94d4af..46f6a8131 100644 --- a/lib/sqlalchemy/orm/relationships.py +++ b/lib/sqlalchemy/orm/relationships.py @@ -438,7 +438,7 @@ class RelationshipProperty(StrategizedProperty): construct a non-standard join condition, which makes use of columns or expressions that do not normally refer to their "parent" column, such as a join condition expressed by a - complex comparison using a SQL function. + complex comparison using an SQL function. The :func:`.relationship` construct will raise informative error messages that suggest the use of the @@ -672,7 +672,7 @@ class RelationshipProperty(StrategizedProperty): :ref:`post_update` - Introductory documentation and examples. :param primaryjoin: - a SQL expression that will be used as the primary + an SQL expression that will be used as the primary join of this child object against the parent object, or in a many-to-many relationship the join of the primary object to the association table. By default, this value is computed based on the @@ -727,7 +727,7 @@ class RelationshipProperty(StrategizedProperty): relationship loaders. :param secondaryjoin: - a SQL expression that will be used as the join of + an SQL expression that will be used as the join of an association table to the child object. By default, this value is computed based on the foreign key relationships of the association and child tables. diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py index 1cf1bdb24..7a99a0e75 100644 --- a/lib/sqlalchemy/orm/session.py +++ b/lib/sqlalchemy/orm/session.py @@ -913,7 +913,7 @@ class Session(_SessionClassMethods): return conn def execute(self, clause, params=None, mapper=None, bind=None, **kw): - """Execute a SQL expression construct or string statement within + """Execute an SQL expression construct or string statement within the current transaction. Returns a :class:`.ResultProxy` representing @@ -2443,7 +2443,7 @@ class Session(_SessionClassMethods): cases, the attribute is assumed to have a change, even if there is ultimately no net change against its database value. SQLAlchemy in most cases does not need the "old" value when a set event occurs, so - it skips the expense of a SQL call if the old value isn't present, + it skips the expense of an SQL call if the old value isn't present, based on the assumption that an UPDATE of the scalar value is usually needed, and in those few cases where it isn't, is less expensive on average than issuing a defensive SELECT. diff --git a/lib/sqlalchemy/orm/strategies.py b/lib/sqlalchemy/orm/strategies.py index 370cb974b..27afe2a98 100644 --- a/lib/sqlalchemy/orm/strategies.py +++ b/lib/sqlalchemy/orm/strategies.py @@ -100,7 +100,7 @@ def _register_attribute( @properties.ColumnProperty.strategy_for(instrument=False, deferred=False) class UninstrumentedColumnLoader(LoaderStrategy): - """Represent the a non-instrumented MapperProperty. + """Represent a non-instrumented MapperProperty. The polymorphic_on argument of mapper() often results in this, if the argument is against the with_polymorphic selectable. diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py index f76be0380..d7c21c726 100644 --- a/lib/sqlalchemy/orm/util.py +++ b/lib/sqlalchemy/orm/util.py @@ -895,7 +895,7 @@ def join( left and right selectables may be not only core selectable objects such as :class:`.Table`, but also mapped classes or :class:`.AliasedClass` instances. The "on" clause can - be a SQL expression, or an attribute or string name + be an SQL expression, or an attribute or string name referencing a configured :func:`.relationship`. :func:`.orm.join` is not commonly needed in modern usage, diff --git a/lib/sqlalchemy/pool.py b/lib/sqlalchemy/pool.py index 4bd8f60ec..a781ac8a9 100644 --- a/lib/sqlalchemy/pool.py +++ b/lib/sqlalchemy/pool.py @@ -906,7 +906,7 @@ class SingletonThreadPool(Pool): :class:`.SingletonThreadPool` may be improved in a future release, however in its current status it is generally used only for test - scenarios using a SQLite ``:memory:`` database and is not recommended + scenarios using an SQLite ``:memory:`` database and is not recommended for production use. diff --git a/lib/sqlalchemy/sql/crud.py b/lib/sqlalchemy/sql/crud.py index 70e03d220..960d1c09a 100644 --- a/lib/sqlalchemy/sql/crud.py +++ b/lib/sqlalchemy/sql/crud.py @@ -343,7 +343,7 @@ def _append_param_insert_pk_returning(compiler, stmt, c, values, kw): If the column has a Python-side default, we will create a bound parameter for it and "pre-execute" the Python function. If - the column has a SQL expression default, or is a sequence, + the column has an SQL expression default, or is a sequence, we will add it directly into the INSERT statement and add a RETURNING element to get the new value. If the column has a server side default or is marked as the "autoincrement" column, diff --git a/lib/sqlalchemy/sql/dml.py b/lib/sqlalchemy/sql/dml.py index 8f368dcdb..601c36619 100644 --- a/lib/sqlalchemy/sql/dml.py +++ b/lib/sqlalchemy/sql/dml.py @@ -643,7 +643,7 @@ class Update(ValuesBase): For databases which support this, an ``UPDATE FROM`` clause will be generated, or on MySQL, a multi-table update. The statement will fail on databases that don't have support for multi-table - update statements. A SQL-standard method of referring to + update statements. An SQL-standard method of referring to additional tables in the WHERE clause is to use a correlated subquery:: @@ -705,7 +705,7 @@ class Update(ValuesBase): The values referred to in ``values`` are typically: * a literal data value (i.e. string, number, etc.) - * a SQL expression, such as a related :class:`.Column`, + * an SQL expression, such as a related :class:`.Column`, a scalar-returning :func:`.select` construct, etc. diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py index 00c2c37ba..90b80853a 100644 --- a/lib/sqlalchemy/sql/elements.py +++ b/lib/sqlalchemy/sql/elements.py @@ -198,7 +198,7 @@ class ClauseElement(Visitable): """return the 'constructor' for this ClauseElement. This is for the purposes for creating a new object of - this type. Usually, its just the element's __class__. + this type. Usually, it's just the element's __class__. However, the "Annotated" version of the object overrides to return the class of its proxied element. @@ -494,7 +494,7 @@ class ColumnElement(operators.ColumnOperators, ClauseElement): While the most familiar kind of :class:`.ColumnElement` is the :class:`.Column` object, :class:`.ColumnElement` serves as the basis - for any unit that may be present in a SQL expression, including + for any unit that may be present in an SQL expression, including the expressions themselves, SQL functions, bound parameters, literal expressions, keywords such as ``NULL``, etc. :class:`.ColumnElement` is the ultimate base class for all such elements. @@ -865,7 +865,7 @@ class BindParameter(ColumnElement): The return value is an instance of :class:`.BindParameter`; this is a :class:`.ColumnElement` subclass which represents a so-called - "placeholder" value in a SQL expression, the value of which is + "placeholder" value in an SQL expression, the value of which is supplied at the point at which the statement in executed against a database connection. @@ -874,7 +874,7 @@ class BindParameter(ColumnElement): used at expression time. In this way, it serves not just as a "placeholder" for eventual population, but also as a means of representing so-called "unsafe" values which should not be rendered - directly in a SQL statement, but rather should be passed along + directly in an SQL statement, but rather should be passed along to the :term:`DBAPI` as values which need to be correctly escaped and potentially handled for type-safety. @@ -1034,7 +1034,7 @@ class BindParameter(ColumnElement): :param quote: True if this parameter name requires quoting and is not - currently known as a SQLAlchemy reserved word; this currently + currently known as an SQLAlchemy reserved word; this currently only applies to the Oracle backend, where bound names must sometimes be quoted. @@ -1161,7 +1161,7 @@ class BindParameter(ColumnElement): class TypeClause(ClauseElement): - """Handle a type keyword in a SQL statement. + """Handle a type keyword in an SQL statement. Used by the ``Case`` statement. @@ -1610,7 +1610,7 @@ class TextClause(Executable, ClauseElement): class Null(ColumnElement): - """Represent the NULL keyword in a SQL statement. + """Represent the NULL keyword in an SQL statement. :class:`.Null` is accessed as a constant via the :func:`.null` function. @@ -1634,7 +1634,7 @@ class Null(ColumnElement): class False_(ColumnElement): - """Represent the ``false`` keyword, or equivalent, in a SQL statement. + """Represent the ``false`` keyword, or equivalent, in an SQL statement. :class:`.False_` is accessed as a constant via the :func:`.false` function. @@ -1693,7 +1693,7 @@ class False_(ColumnElement): class True_(ColumnElement): - """Represent the ``true`` keyword, or equivalent, in a SQL statement. + """Represent the ``true`` keyword, or equivalent, in an SQL statement. :class:`.True_` is accessed as a constant via the :func:`.true` function. @@ -1966,7 +1966,7 @@ or_ = BooleanClauseList.or_ class Tuple(ClauseList, ColumnElement): - """Represent a SQL tuple.""" + """Represent an SQL tuple.""" def __init__(self, *clauses, **kw): """Return a :class:`.Tuple`. @@ -2306,7 +2306,7 @@ class Cast(ColumnElement): with a specific type, but does not render the ``CAST`` expression in SQL. - :param expression: A SQL expression, such as a :class:`.ColumnElement` + :param expression: An SQL expression, such as a :class:`.ColumnElement` expression or a Python string which will be coerced into a bound literal value. @@ -2354,7 +2354,7 @@ class TypeCoerce(ColumnElement): __visit_name__ = 'type_coerce' def __init__(self, expression, type_): - """Associate a SQL expression with a particular type, without rendering + """Associate an SQL expression with a particular type, without rendering ``CAST``. E.g.:: @@ -2402,7 +2402,7 @@ class TypeCoerce(ColumnElement): except that it does not render the ``CAST`` expression in the resulting statement. - :param expression: A SQL expression, such as a :class:`.ColumnElement` + :param expression: An SQL expression, such as a :class:`.ColumnElement` expression or a Python string which will be coerced into a bound literal value. @@ -2439,7 +2439,7 @@ class TypeCoerce(ColumnElement): class Extract(ColumnElement): - """Represent a SQL EXTRACT clause, ``extract(field FROM expr)``.""" + """Represent an SQL EXTRACT clause, ``extract(field FROM expr)``.""" __visit_name__ = 'extract' @@ -3706,7 +3706,7 @@ class ColumnClause(Immutable, ColumnElement): def _make_proxy(self, selectable, name=None, attach=True, name_is_truncatable=False, **kw): # propagate the "is_literal" flag only if we are keeping our name, - # otherwise its considered to be a label + # otherwise it's considered to be a label is_literal = self.is_literal and (name is None or name == self.name) c = self._constructor( _as_truncated(name or self.name) if @@ -3751,7 +3751,7 @@ class ReleaseSavepointClause(_IdentifiedClause): class quoted_name(util.MemoizedSlots, util.text_type): - """Represent a SQL identifier combined with quoting preferences. + """Represent an SQL identifier combined with quoting preferences. :class:`.quoted_name` is a Python unicode/str subclass which represents a particular identifier name along with a @@ -4125,7 +4125,7 @@ def _no_literals(element): return element.__clause_element__() elif not isinstance(element, Visitable): raise exc.ArgumentError("Ambiguous literal: %r. Use the 'text()' " - "function to indicate a SQL expression " + "function to indicate an SQL expression " "literal, or 'literal()' to indicate a " "bound value." % element) else: diff --git a/lib/sqlalchemy/sql/functions.py b/lib/sqlalchemy/sql/functions.py index e6df07056..288fce39e 100644 --- a/lib/sqlalchemy/sql/functions.py +++ b/lib/sqlalchemy/sql/functions.py @@ -369,7 +369,7 @@ func = _FunctionGenerator() In a few exception cases, the :data:`.func` accessor will redirect a name to a built-in expression such as :func:`.cast` or :func:`.extract`, as these names have well-known meaning - but are not exactly the same as "functions" from a SQLAlchemy + but are not exactly the same as "functions" from an SQLAlchemy perspective. .. versionadded:: 0.8 :data:`.func` can return non-function expression diff --git a/lib/sqlalchemy/sql/operators.py b/lib/sqlalchemy/sql/operators.py index 80f08a97c..33b6baa86 100644 --- a/lib/sqlalchemy/sql/operators.py +++ b/lib/sqlalchemy/sql/operators.py @@ -240,7 +240,7 @@ class ColumnOperators(Operators): :meth:`.operate` or :meth:`.reverse_operate`, passing in the appropriate operator function from the Python builtin ``operator`` module or - a SQLAlchemy-specific operator function from + an SQLAlchemy-specific operator function from :mod:`sqlalchemy.expression.operators`. For example the ``__eq__`` function:: diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py index 5e709b1e3..332b494a8 100644 --- a/lib/sqlalchemy/sql/schema.py +++ b/lib/sqlalchemy/sql/schema.py @@ -1918,7 +1918,7 @@ class ColumnDefault(DefaultGenerator): """A plain default value on a column. This could correspond to a constant, a callable function, - or a SQL clause. + or an SQL clause. :class:`.ColumnDefault` is generated automatically whenever the ``default``, ``onupdate`` arguments of @@ -1946,7 +1946,7 @@ class ColumnDefault(DefaultGenerator): * a plain non-callable Python value, such as a string, integer, boolean, or other simple type. The default value will be used as is each time. - * a SQL expression, that is one which derives from + * an SQL expression, that is one which derives from :class:`.ColumnElement`. The SQL expression will be rendered into the INSERT or UPDATE statement, or in the case of a primary key column when @@ -2025,7 +2025,7 @@ class Sequence(DefaultGenerator): The :class:`.Sequence` object represents the name and configurational parameters of a database sequence. It also represents - a construct that can be "executed" by a SQLAlchemy :class:`.Engine` + a construct that can be "executed" by an SQLAlchemy :class:`.Engine` or :class:`.Connection`, rendering the appropriate "next value" function for the target database and returning a result. @@ -2351,7 +2351,7 @@ class Constraint(DialectKWArgs, SchemaItem): def __init__(self, name=None, deferrable=None, initially=None, _create_rule=None, info=None, _type_bound=False, **dialect_kw): - """Create a SQL constraint. + """Create an SQL constraint. :param name: Optional, the in-database name of this ``Constraint``. @@ -2606,7 +2606,7 @@ class CheckConstraint(ColumnCollectionConstraint): :param sqltext: A string containing the constraint definition, which will be used - verbatim, or a SQL expression construct. If given as a string, + verbatim, or an SQL expression construct. If given as a string, the object is converted to a :class:`.Text` object. If the textual string includes a colon character, escape this using a backslash:: diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py index e299f067e..94b640876 100644 --- a/lib/sqlalchemy/sql/selectable.py +++ b/lib/sqlalchemy/sql/selectable.py @@ -357,7 +357,7 @@ class FromClause(Selectable): may also be a selectable-compatible object such as an ORM-mapped class. - :param onclause: a SQL expression representing the ON clause of the + :param onclause: an SQL expression representing the ON clause of the join. If left at ``None``, :meth:`.FromClause.join` will attempt to join the two tables based on a foreign key relationship. @@ -402,7 +402,7 @@ class FromClause(Selectable): may also be a selectable-compatible object such as an ORM-mapped class. - :param onclause: a SQL expression representing the ON clause of the + :param onclause: an SQL expression representing the ON clause of the join. If left at ``None``, :meth:`.FromClause.join` will attempt to join the two tables based on a foreign key relationship. @@ -767,7 +767,7 @@ class Join(FromClause): may also be a selectable-compatible object such as an ORM-mapped class. - :param onclause: a SQL expression representing the ON clause of the + :param onclause: an SQL expression representing the ON clause of the join. If left at ``None``, :meth:`.FromClause.join` will attempt to join the two tables based on a foreign key relationship. @@ -1124,7 +1124,7 @@ class Alias(FromClause): """Represents an table or selectable alias (AS). Represents an alias, as typically applied to any table or - sub-select within a SQL statement using the ``AS`` keyword (or + sub-select within an SQL statement using the ``AS`` keyword (or without the keyword on certain databases such as Oracle). This object is constructed from the :func:`~.expression.alias` module @@ -1316,7 +1316,7 @@ class HasCTE(object): def cte(self, name=None, recursive=False): """Return a new :class:`.CTE`, or Common Table Expression instance. - Common table expressions are a SQL standard whereby SELECT + Common table expressions are an SQL standard whereby SELECT statements can draw upon secondary statements specified along with the primary statement, using a clause called "WITH". Special semantics regarding UNION can also be employed to @@ -1939,14 +1939,14 @@ class GenerativeSelect(SelectBase): @property def _simple_int_limit(self): """True if the LIMIT clause is a simple integer, False - if it is not present or is a SQL expression. + if it is not present or is an SQL expression. """ return isinstance(self._limit_clause, _OffsetLimitParam) @property def _simple_int_offset(self): """True if the OFFSET clause is a simple integer, False - if it is not present or is a SQL expression. + if it is not present or is an SQL expression. """ return isinstance(self._offset_clause, _OffsetLimitParam) @@ -1973,7 +1973,7 @@ class GenerativeSelect(SelectBase): .. versionchanged:: 1.0.0 - :meth:`.Select.limit` can now accept arbitrary SQL expressions as well as integer values. - :param limit: an integer LIMIT parameter, or a SQL expression + :param limit: an integer LIMIT parameter, or an SQL expression that provides an integer result. """ @@ -1995,7 +1995,7 @@ class GenerativeSelect(SelectBase): .. versionchanged:: 1.0.0 - :meth:`.Select.offset` can now accept arbitrary SQL expressions as well as integer values. - :param offset: an integer OFFSET parameter, or a SQL expression + :param offset: an integer OFFSET parameter, or an SQL expression that provides an integer result. """ @@ -3360,40 +3360,40 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect): return FromGrouping(self) def union(self, other, **kwargs): - """return a SQL UNION of this select() construct against the given + """return an SQL UNION of this select() construct against the given selectable.""" return CompoundSelect._create_union(self, other, **kwargs) def union_all(self, other, **kwargs): - """return a SQL UNION ALL of this select() construct against the given + """return an SQL UNION ALL of this select() construct against the given selectable. """ return CompoundSelect._create_union_all(self, other, **kwargs) def except_(self, other, **kwargs): - """return a SQL EXCEPT of this select() construct against the given + """return an SQL EXCEPT of this select() construct against the given selectable.""" return CompoundSelect._create_except(self, other, **kwargs) def except_all(self, other, **kwargs): - """return a SQL EXCEPT ALL of this select() construct against the + """return an SQL EXCEPT ALL of this select() construct against the given selectable. """ return CompoundSelect._create_except_all(self, other, **kwargs) def intersect(self, other, **kwargs): - """return a SQL INTERSECT of this select() construct against the given + """return an SQL INTERSECT of this select() construct against the given selectable. """ return CompoundSelect._create_intersect(self, other, **kwargs) def intersect_all(self, other, **kwargs): - """return a SQL INTERSECT ALL of this select() construct against the + """return an SQL INTERSECT ALL of this select() construct against the given selectable. """ diff --git a/lib/sqlalchemy/sql/sqltypes.py b/lib/sqlalchemy/sql/sqltypes.py index 81630fe4f..97b0b349d 100644 --- a/lib/sqlalchemy/sql/sqltypes.py +++ b/lib/sqlalchemy/sql/sqltypes.py @@ -1636,7 +1636,7 @@ class Interval(_DateAffinity, TypeDecorator): class JSON(Indexable, TypeEngine): - """Represent a SQL JSON type. + """Represent an SQL JSON type. .. note:: :class:`.types.JSON` is provided as a facade for vendor-specific JSON types. Since it supports JSON SQL operations, it only @@ -1850,7 +1850,7 @@ class JSON(Indexable, TypeEngine): class ARRAY(Indexable, Concatenable, TypeEngine): - """Represent a SQL Array type. + """Represent an SQL Array type. .. note:: This type serves as the basis for all ARRAY operations. However, currently **only the Postgresql backend has support @@ -2077,7 +2077,7 @@ class ARRAY(Indexable, Concatenable, TypeEngine): :param as_tuple=False: Specify whether return results should be converted to tuples from lists. This parameter is not generally needed as a Python list corresponds well - to a SQL array. + to an SQL array. :param dimensions: if non-None, the ARRAY will assume a fixed number of dimensions. This impacts how the array is declared @@ -2370,7 +2370,7 @@ def _resolve_value_to_type(value): insp.__class__ in inspection._registrars ): raise exc.ArgumentError( - "Object %r is not legal as a SQL literal value" % value) + "Object %r is not legal as an SQL literal value" % value) return NULLTYPE else: return _result_type diff --git a/lib/sqlalchemy/sql/type_api.py b/lib/sqlalchemy/sql/type_api.py index 2a7adf8af..3193db14d 100644 --- a/lib/sqlalchemy/sql/type_api.py +++ b/lib/sqlalchemy/sql/type_api.py @@ -277,7 +277,7 @@ class TypeEngine(Visitable): def column_expression(self, colexpr): """Given a SELECT column expression, return a wrapping SQL expression. - This is typically a SQL function that wraps a column expression + This is typically an SQL function that wraps a column expression as rendered in the columns clause of a SELECT statement. It is used for special data types that require columns to be wrapped in some special database function in order @@ -310,9 +310,9 @@ class TypeEngine(Visitable): def bind_expression(self, bindvalue): """"Given a bind value (i.e. a :class:`.BindParameter` instance), - return a SQL expression in its place. + return an SQL expression in its place. - This is typically a SQL function that wraps the existing bound + This is typically an SQL function that wraps the existing bound parameter within the statement. It is used for special data types that require literals being wrapped in some special database function in order to coerce an application-level value into a database-specific @@ -501,7 +501,7 @@ class TypeEngine(Visitable): to return a type which the value should be coerced into. The default behavior here is conservative; if the right-hand - side is already coerced into a SQL type based on its + side is already coerced into an SQL type based on its Python type, it is usually left alone. End-user functionality extension here should generally be via @@ -1046,7 +1046,7 @@ class TypeDecorator(SchemaEventTarget, TypeEngine): :meth:`process_bind_param` here. User-defined code can override this method directly, - though its likely best to use :meth:`process_bind_param` so that + although it's likely best to use :meth:`process_bind_param` so that the processing provided by ``self.impl`` is maintained. :param dialect: Dialect instance in use. @@ -1092,7 +1092,7 @@ class TypeDecorator(SchemaEventTarget, TypeEngine): :meth:`process_result_value` here. User-defined code can override this method directly, - though its likely best to use :meth:`process_result_value` so that + although it's likely best to use :meth:`process_result_value` so that the processing provided by ``self.impl`` is maintained. :param dialect: Dialect instance in use. @@ -1124,7 +1124,7 @@ class TypeDecorator(SchemaEventTarget, TypeEngine): By default, returns self. This method is called by the expression system when an object using this type is on the left or right side of an expression against a plain Python - object which does not yet have a SQLAlchemy type assigned:: + object which does not yet have an SQLAlchemy type assigned:: expr = table.c.somecolumn + 35 diff --git a/lib/sqlalchemy/testing/suite/test_results.py b/lib/sqlalchemy/testing/suite/test_results.py index 9ffaa6e04..2dfa8a79a 100644 --- a/lib/sqlalchemy/testing/suite/test_results.py +++ b/lib/sqlalchemy/testing/suite/test_results.py @@ -95,7 +95,7 @@ class RowFetchTest(fixtures.TablesTest): """test that a scalar select as a column is returned as such and that type conversion works OK. - (this is half a SQLAlchemy Core test and half to catch database + (this is half an SQLAlchemy Core test and half to catch database backends that may have unusual behavior with scalar selects.) """ diff --git a/lib/sqlalchemy/util/_collections.py b/lib/sqlalchemy/util/_collections.py index c29b81f6a..5d8764be1 100644 --- a/lib/sqlalchemy/util/_collections.py +++ b/lib/sqlalchemy/util/_collections.py @@ -863,7 +863,7 @@ class LRUCache(dict): recently used items. Note that either get() or [] should be used here, but - generally its not safe to do an "in" check first as the dictionary + generally it's not safe to do an "in" check first as the dictionary can change subsequent to that call. """ |