summaryrefslogtreecommitdiff
path: root/test/sql
Commit message (Collapse)AuthorAgeFilesLines
* - The SQL compiler now generates the mapping of expected columnspositional_targetingMike Bayer2015-03-072-1/+43
| | | | | | | | | | | | | | | | | such that they are matched to the received result set positionally, rather than by name. Originally, this was seen as a way to handle cases where we had columns returned with difficult-to-predict names, though in modern use that issue has been overcome by anonymous labeling. In this version, the approach basically reduces function call count per-result by a few dozen calls, or more for larger sets of result columns. The approach still degrades into a modern version of the old approach if textual elements modify the result map, or if any discrepancy in size exists between the compiled set of columns versus what was received, so there's no issue for partially or fully textual compilation scenarios where these lists might not line up. fixes #918 - callcounts still need to be adjusted down for this so zoomark tests won't pass at the moment
* - expect_warnings was not expecting and neither was assert_warningsMike Bayer2015-02-191-4/+4
| | | | asserting.
* - test skips for MySQL w new cast warningMike Bayer2015-02-091-0/+16
|
* - Literal values within a :class:`.DefaultClause`, which is invokedMike Bayer2015-02-091-3/+70
| | | | | | | when using the :paramref:`.Column.server_default` parameter, will now be rendered using the "inline" compiler, so that they are rendered as-is, rather than as bound parameters. fixes #3087
* - The :class:`.CheckConstraint` construct now supports namingMike Bayer2015-01-302-1/+22
| | | | | | | | | | conventions that include the token ``%(column_0_name)s``; the constraint expression is scanned for columns. Additionally, naming conventions for check constraints that don't include the ``%(constraint_name)s`` token will now work for :class:`.SchemaType`- generated constraints, such as those of :class:`.Boolean` and :class:`.Enum`; this stopped working in 0.9.7 due to :ticket:`3067`. fixes #3299
* - Fixed bug in 0.9's foreign key setup system, such thatMike Bayer2015-01-281-0/+92
| | | | | | | | | | | | | | the logic used to link a :class:`.ForeignKey` to its parent could fail when the foreign key used "link_to_name=True" in conjunction with a target :class:`.Table` that would not receive its parent column until later, such as within a reflection + "useexisting" scenario, if the target column in fact had a key value different from its name, as would occur in reflection if column reflect events were used to alter the .key of reflected :class:`.Column` objects so that the link_to_name becomes significant. Also repaired support for column type via FK transmission in a similar way when target columns had a different key and were referenced using link_to_name. fixes #3298
* - fix this test for py3kMike Bayer2015-01-261-1/+1
|
* Added psycopg2cffi dialectShaun Stanworth2015-01-261-0/+1
|
* Merge remote-tracking branch 'origin/pr/150'Mike Bayer2015-01-261-1/+2
|\
| * Report the type of unexpected expression objectspr/150Ryan P. Kelly2014-11-201-1/+2
| |
* | - rework assertsql system, fixes #3293Mike Bayer2015-01-181-6/+6
| |
* | - Custom dialects that implement :class:`.GenericTypeCompiler` canMike Bayer2015-01-161-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | now be constructed such that the visit methods receive an indication of the owning expression object, if any. Any visit method that accepts keyword arguments (e.g. ``**kw``) will in most cases receive a keyword argument ``type_expression``, referring to the expression object that the type is contained within. For columns in DDL, the dialect's compiler class may need to alter its ``get_column_specification()`` method to support this as well. The ``UserDefinedType.get_col_spec()`` method will also receive ``type_expression`` if it provides ``**kw`` in its argument signature. fixes #3074
* | - The multi-values version of :meth:`.Insert.values` has beenMike Bayer2015-01-132-29/+129
| | | | | | | | | | | | | | | | | | | | | | | | repaired to work more usefully with tables that have Python- side default values and/or functions, as well as server-side defaults. The feature will now work with a dialect that uses "positional" parameters; a Python callable will also be invoked individually for each row just as is the case with an "executemany" style invocation; a server- side default column will no longer implicitly receive the value explicitly specified for the first row, instead refusing to invoke without an explicit value. fixes #3288
* | repair formattingMike Bayer2015-01-121-1/+4
| |
* | Add native_enum flag to Enum's repr() resultDimitris Theodorou2015-01-121-2/+2
| | | | | | | | Needed for alembic autogenerate rendering.
* | - add a close hereMike Bayer2015-01-061-0/+1
| |
* | - start trying to move things into __slots__. This seems to reduce theslotsMike Bayer2015-01-041-7/+9
| | | | | | | | | | size of the many per-column objects we're hitting, but somehow the overall memory is hardly being reduced at all in initial testing
* | - restate sort_tables in terms of a more fine grainedMike Bayer2015-01-012-27/+247
| | | | | | | | | | | | | | | | | | | | | | | | | | sort_tables_and_constraints function. - The DDL generation system of :meth:`.MetaData.create_all` and :meth:`.Metadata.drop_all` has been enhanced to in most cases automatically handle the case of mutually dependent foreign key constraints; the need for the :paramref:`.ForeignKeyConstraint.use_alter` flag is greatly reduced. The system also works for constraints which aren't given a name up front; only in the case of DROP is a name required for at least one of the constraints involved in the cycle. fixes #3282
* | - Added a new accessor :attr:`.Table.foreign_key_constraints`Mike Bayer2015-01-011-0/+40
| | | | | | | | | | to complement the :attr:`.Table.foreign_keys` collection, as well as :attr:`.ForeignKeyConstraint.referred_table`.
* | - Fixed bug where using a :class:`.TypeDecorator` that implementedMike Bayer2014-12-191-0/+25
| | | | | | | | | | | | | | a type that was also a :class:`.TypeDecorator` would fail with Python's "Cannot create a consistent method resolution order (MRO)" error, when any kind of SQL comparison expression were used against an object using this type.
* | - enhance only_on() to work with compound specsMike Bayer2014-12-061-1/+2
| | | | | | | | - fix "temporary_tables" requirement
* | - the refactor of the visit_alias() method in Oracle revealedMike Bayer2014-12-041-1/+1
| | | | | | | | that quoting should be applied in %(name)s under with_hint.
* | - Added support for CTEs under Oracle. This includes some tweaksMike Bayer2014-12-041-0/+30
| | | | | | | | | | | | | | to the aliasing syntax, as well as a new CTE feature :meth:`.CTE.suffix_with`, which is useful for adding in special Oracle-specific directives to the CTE. fixes #3220
* | - The :meth:`.Operators.match` operator is now handled such that theMike Bayer2014-12-041-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | return type is not strictly assumed to be boolean; it now returns a :class:`.Boolean` subclass called :class:`.MatchType`. The type will still produce boolean behavior when used in Python expressions, however the dialect can override its behavior at result time. In the case of MySQL, while the MATCH operator is typically used in a boolean context within an expression, if one actually queries for the value of a match expression, a floating point value is returned; this value is not compatible with SQLAlchemy's C-based boolean processor, so MySQL's result-set behavior now follows that of the :class:`.Float` type. A new operator object ``notmatch_op`` is also added to better allow dialects to define the negation of a match operation. fixes #3263
* | Merge remote-tracking branch 'origin/pr/151' into pr151Mike Bayer2014-12-013-1/+4
|\ \
| * \ Merge branch 'master' into fdbsql-testsScott Dugas2014-11-039-32/+445
| |\ \ | | | | | | | | | | | | | | | | Conflicts: lib/sqlalchemy/testing/exclusions.py
| * | | Added requirement for temporary tablesScott Dugas2014-10-301-0/+1
| | | |
| * | | Set the length for MyType implementationScott Dugas2014-10-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mysql drops the type in these tests, when it does visit_typeclause, since it's an unkown type it just says none, and doesn't do a cast. Firebird also doesn't support varchar with length, it throws an error on these types.
| * | | require check constraints for testsScott Dugas2014-10-232-0/+2
| | | |
* | | | - Fixed bug in :meth:`.Table.tometadata` method where theMike Bayer2014-11-291-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | :class:`.CheckConstraint` associated with a :class:`.Boolean` or :class:`.Enum` type object would be doubled in the target table. The copy process now tracks the production of this constraint object as local to a type object. fixes #3260
* | | | - The behavioral contract of the :attr:`.ForeignKeyConstraint.columns`Mike Bayer2014-11-251-0/+44
| |_|/ |/| | | | | | | | | | | | | | | | | | | | collection has been made consistent; this attribute is now a :class:`.ColumnCollection` like that of all other constraints and is initialized at the point when the constraint is associated with a :class:`.Table`. fixes #3243
* | | - Fixed issue where the columns from a SELECT embedded in anMike Bayer2014-11-112-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | INSERT, either through the values clause or as a "from select", would pollute the column types used in the result set produced by the RETURNING clause when columns from both statements shared the same name, leading to potential errors or mis-adaptation when retrieving the returning rows. fixes #3248
* | | - The :attr:`.Column.key` attribute is now used as the source ofMike Bayer2014-11-101-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | anonymous bound parameter names within expressions, to match the existing use of this value as the key when rendered in an INSERT or UPDATE statement. This allows :attr:`.Column.key` to be used as a "substitute" string to work around a difficult column name that doesn't translate well into a bound parameter name. Note that the paramstyle is configurable on :func:`.create_engine` in any case, and most DBAPIs today support a named and positional style. fixes #3245
* | | - Fixed bug regarding expression mutations which could expressMike Bayer2014-11-052-1/+37
| |/ |/| | | | | | | | | | | | | itself as a "Could not locate column" error when using :class:`.Query` to select from multiple, anonymous column entities when querying against SQLite, as a side effect of the "join rewriting" feature used by the SQLite dialect. fixes #3241
* | - ensure kwargs are passed for limit clause on a compound select as well,Mike Bayer2014-10-311-0/+16
| | | | | | | | further fixes for #3034
* | - changelog for pullreq github:139Mike Bayer2014-10-211-0/+36
| | | | | | | | | | - add support for self-referential foreign keys to move over as well when the table name is changed.
* | Merge remote-tracking branch 'origin/pr/139' into pr139Mike Bayer2014-10-211-0/+44
|\ \
| * | add simple tests for new name argument for Table.tometadata()pr/139ndparker2014-10-041-0/+44
| | |
* | | - Reversing a change that was made in 0.9, the "singleton" natureMike Bayer2014-10-191-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | of the "constants" :func:`.null`, :func:`.true`, and :func:`.false` has been reverted. These functions returning a "singleton" object had the effect that different instances would be treated as the same regardless of lexical use, which in particular would impact the rendering of the columns clause of a SELECT statement. fixes #3170
* | | - Exception messages have been spiffed up a bit. The SQL statementMike Bayer2014-10-171-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and parameters are not displayed if None, reducing confusion for error messages that weren't related to a statement. The full module and classname for the DBAPI-level exception is displayed, making it clear that this is a wrapped DBAPI exception. The statement and parameters themselves are bounded within a bracketed sections to better isolate them from the error message and from each other. fixes #3172
* | | - additional issues fixed in mysqlconnector 2.0.1Mike Bayer2014-10-131-15/+0
| | |
* | | - Mysqlconnector as of version 2.0, probably as a side effect ofMike Bayer2014-10-121-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the python 3 merge, now does not expect percent signs (e.g. as used as the modulus operator and others) to be doubled, even when using the "pyformat" bound parameter format (this change is not documented by Mysqlconnector). The dialect now checks for py2k and for mysqlconnector less than version 2.0 when detecting if the modulus operator should be rendered as ``%%`` or ``%``. - Unicode SQL is now passed for MySQLconnector version 2.0 and above; for Py2k and MySQL < 2.0, strings are encoded. Note that mysqlconnector as of 2.0.1 appears to have a bug with unicode DDL on py2k, so the tests here are skipping until we observe it's fixed. - take out profiling on mysqlconnector, callcounts vary too much with its current development speed
* | | - :meth:`.Insert.from_select` now includes Python and SQL-expressionMike Bayer2014-10-102-2/+145
| | | | | | | | | | | | | | | | | | | | | defaults if otherwise unspecified; the limitation where non- server column defaults aren't included in an INSERT FROM SELECT is now lifted and these expressions are rendered as constants into the SELECT statement.
* | | - Fixed bug where a fair number of SQL elements withinMike Bayer2014-10-091-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | the sql package would fail to ``__repr__()`` successfully, due to a missing ``description`` attribute that would then invoke a recursion overflow when an internal AttributeError would then re-invoke ``__repr__()``. fixes #3195
* | | - changelog, migration for pr github:134Mike Bayer2014-10-042-92/+111
| | |
* | | Merge remote-tracking branch 'origin/pr/134' into pr134Mike Bayer2014-10-042-0/+96
|\ \ \
| * | | allow windowing filtered functionsIlja Everilä2014-09-111-0/+27
| | | |
| * | | renamed aggregatefilter to funcfilter, since it is thatIlja Everilä2014-09-112-2/+2
| | | |
| * | | add ClauseTest for aggregatefilterIlja Everilä2014-09-101-0/+5
| | | |
| * | | tests for <aggregate_fun> FILTER (WHERE ...)Ilja Everilä2014-09-101-0/+64
| | | |