summaryrefslogtreecommitdiff
path: root/test/dialect/mssql/test_compiler.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Recognize brackets, quoted_name in SQL Server schemaMike Bayer2017-04-041-7/+95
| | | | | | | | | | | | | The SQL Server dialect now allows for a database and/or owner name with a dot inside of it, using brackets explicitly in the string around the owner and optionally the database name as well. In addition, sending the :class:`.quoted_name` construct for the schema name will not split on the dot and will deliver the full string as the "owner". :class:`.quoted_name` is also now available from the ``sqlalchemy.sql`` import space. Change-Id: I77491d63ce47638bd23787d903ccde2f35a9d43d Fixes: #2626
* Make all tests to be PEP8 compliantKhairi Hafsham2017-02-071-0/+1
| | | | | | | | tested using pycodestyle version 2.2.0 Fixes: #3885 Change-Id: I5df43adc3aefe318f9eeab72a078247a548ec566 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/343
* Deprecate FromClause.count()Mike Bayer2016-06-141-1/+2
| | | | | | | | | | | count() here is misleading in that it not only counts from an arbitrary column in the table, it also does not make accommodations for DISTINCT, JOIN, etc. as the ORM-level function does. Core should not be attempting to provide a function like this. Change-Id: I9916fc51ef744389a92c54660ab08e9695b8afc2 Fixes: #3724
* Allow creating explicit non-clustered keys and indexes MS SQL.Saulius Žemaitaitis2016-06-061-0/+38
| | | | | | | | | | mssql_clustered=False on Index, UniqueConstraint, PrimaryKeyConstraint now renders NONCLUSTERED. The default of mssql_clustered is now None. Co-Authored-By: mike bayer <mike_mp@zzzcomputing.com> Change-Id: Id6b8d840e355be8f8fa72360cb4b6d2617ba72cf Pull-request: https://github.com/zzzeek/sqlalchemy/pull/252
* Fix label referencing in SQL Server OFFSET logicMike Bayer2016-05-101-0/+25
| | | | | | | | | | Fixed bug where by ROW_NUMBER OVER clause applied for OFFSET selects in SQL Server would inappropriately substitute a plain column from the local statement that overlaps with a label name used by the ORDER BY criteria of the statement. Change-Id: Ic2500c886cbfc83a1ad5a2681783f008b9f23838 Fixes: #3711
* - reworked the way the "select_wraps_for" expression isMike Bayer2016-02-201-1/+25
| | | | | | | | | | | | | | | | | | | | | | | handled within visit_select(); this attribute was added in the 1.0 series to accommodate the subquery wrapping behavior of SQL Server and Oracle while also working with positional column targeting and no longer relying upon "key fallback" in order to target columns in such a statement. The IBM DB2 third-party dialect also has this use case, but its implementation is using regular expressions to rewrite the textual SELECT only and does not make use of a "wrapped" select at this time. The logic no longer attempts to reconcile proxy set collections as this was not deterministic, and instead assumes that the select() and the wrapper select() match their columns postionally, at least for the column positions they have in common, so it is now very simple and safe. fixes #3657. - as a side effect of #3657 it was also revealed that the strategy of calling upon a ResultProxy._getter was not correctly calling into NoSuchColumnError when an expected column was not present, and instead returned None up to loading.instances() to produce NoneType failures; added a raiseerr argument to _getter() which is called when we aren't expecting None, fixes #3658.
* - there was a DATEPART test after all, fix formatMike Bayer2016-01-141-1/+1
|
* - The ``legacy_schema_aliasing`` flag, introduced in version 1.0.5Mike Bayer2015-09-191-1/+1
| | | | | | | as part of :ticket:`3424` to allow disabling of the MSSQL dialect's attempts to create aliases for schema-qualified tables, now defaults to False; the old behavior is now disabled unless explicitly turned on. fixes #3434
* - Added a new dialect flag to the MSSQL dialectMike Bayer2015-05-241-16/+61
| | | | | | | | | | | | | | | | | | | | | | | ``legacy_schema_aliasing`` which when set to False will disable a very old and obsolete behavior, that of the compiler's attempt to turn all schema-qualified table names into alias names, to work around old and no longer locatable issues where SQL server could not parse a multi-part identifier name in all circumstances. The behavior prevented more sophisticated statements from working correctly, including those which use hints, as well as CRUD statements that embed correlated SELECT statements. Rather than continue to repair the feature to work with more complex statements, it's better to just disable it as it should no longer be needed for any modern SQL server version. The flag defaults to True for the 1.0.x series, leaving current behavior unchanged for this version series. In the 1.1 series, it will default to False. For the 1.0 series, when not set to either value explicitly, a warning is emitted when a schema-qualified table is first used in a statement, which suggests that the flag be set to False for all modern SQL Server versions. fixes #3424 fixes #3430
* - autopep8Mike Bayer2015-05-241-117/+140
|
* - fix some more result_map callsMike Bayer2015-03-081-6/+6
|
* - the change for #918 was of course not nearly that simple.Mike Bayer2015-03-071-1/+17
| | | | | | | | | | | | | | | | | | The "wrapping" employed by the mssql and oracle dialects using the "iswrapper" argument was not being used intelligently by the compiler, and the result map was being written incorrectly, using *more* columns in the result map than were actually returned by the statement, due to "row number" columns that are inside the subquery. The compiler now writes out result map on the "top level" select in all cases fully, and for the mssql/oracle wrapping case extracts out the "proxied" columns in a second step, which only includes those columns that are proxied outwards to the top level. This change might have implications for 3rd party dialects that might be imitating oracle's approach. They can safely continue to use the "iswrapper" kw which is now ignored, but they may need to also add the _select_wraps argument as well.
* - more tests, including backend testsMike Bayer2014-05-161-6/+6
| | | | - implement for SQL server, use window functions when simple limit/offset not available
* Support mssql_clustered option on UniqueConstraint (plus docs and test)donkopotamus2014-01-171-0/+12
|
* Remove support for mssql_clustered on Tabledonkopotamus2014-01-171-12/+1
|
* Support mssql_clustered option in mssql dialect for both Table and ↵donkopotamus2014-01-141-0/+22
| | | | PrimaryKeyConstraint
* - changelog + test for pullreq #7, MSSQL dialect for DROP INDEXMike Bayer2013-12-051-0/+11
|
* - Fixed bug in default compiler plus those of postgresql, mysql, andMike Bayer2013-10-121-0/+10
| | | | | | | | mssql to ensure that any literal SQL expression values are rendered directly as literals, instead of as bound parameters, within a CREATE INDEX statement. [ticket:2742] - don't need expression_as_ddl(); literal_binds and include_table take care of this functionality.
* refactor test suites for postgresql, mssql, mysql into packages.Mike Bayer2013-06-281-0/+579