diff options
Diffstat (limited to 'lib/sqlalchemy/sql')
-rw-r--r-- | lib/sqlalchemy/sql/crud.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/sql/dml.py | 4 | ||||
-rw-r--r-- | lib/sqlalchemy/sql/elements.py | 34 | ||||
-rw-r--r-- | lib/sqlalchemy/sql/functions.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/sql/operators.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/sql/schema.py | 10 | ||||
-rw-r--r-- | lib/sqlalchemy/sql/selectable.py | 30 | ||||
-rw-r--r-- | lib/sqlalchemy/sql/sqltypes.py | 8 | ||||
-rw-r--r-- | lib/sqlalchemy/sql/type_api.py | 14 |
9 files changed, 53 insertions, 53 deletions
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 |