summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mssql/base.py
Commit message (Collapse)AuthorAgeFilesLines
* Update to correct TDS version; FreeTDS only supports up to 7.3. 8.0 is not a ↵pr/176Allen, Timothy2015-05-281-2/+6
| | | | valid version (Microsoft released the spec late).
* - Fixed bug where known boolean values used byMike Bayer2015-05-261-0/+4
| | | | | | | | :func:`.engine_from_config` were not being parsed correctly; these included ``pool_threadlocal`` and the psycopg2 argument ``use_native_unicode``. fixes #3435 - add legacy_schema_aliasing config parsing for mssql - move use_native_unicode config arg to the psycopg2 dialect
* - Added a new dialect flag to the MSSQL dialectMike Bayer2015-05-241-28/+107
| | | | | | | | | | | | | | | | | | | | | | | ``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
* - Fixed a regression that was incorrectly fixed in 1.0.0b4Mike Bayer2015-04-241-1/+0
| | | | | | | | | | | | | | | | | | (hence becoming two regressions); reports that SELECT statements would GROUP BY a label name and fail was misconstrued that certain backends such as SQL Server should not be emitting ORDER BY or GROUP BY on a simple label name at all; when in fact, we had forgotten that 0.9 was already emitting ORDER BY on a simple label name for all backends, as described in :ref:`migration_1068`, as 1.0 had rewritten this logic as part of :ticket:`2992`. In 1.0.2, the bug is fixed both that SQL Server, Firebird and others will again emit ORDER BY on a simple label name when passed a :class:`.Label` construct that is expressed in the columns clause, and no backend will emit GROUP BY on a simple label name in this case, as even Postgresql can't reliably do GROUP BY on a simple name in every case. fixes #3338, fixes #3385
* - Fixed support for "literal_binds" mode when using limit/offsetMike Bayer2015-04-231-2/+3
| | | | | | with Firebird, so that the values are again rendered inline when this is selected. Related to :ticket:`3034`. fixes #3381
* - Turned off the "simple order by" flag on the MSSQL dialect; thisMike Bayer2015-03-241-0/+1
| | | | | | | | | | | is the flag that per :ticket:`2992` causes an order by or group by an expression that's also in the columns clause to be copied by label, even if referenced as the expression object. The behavior for MSSQL is now the old behavior that copies the whole expression in by default, as MSSQL can be picky on these particularly in GROUP BY expressions. fixes #3338 - Add a test that includes a composed label in a GROUP BY
* - copyright 2015Mike Bayer2015-03-101-1/+1
|
* - rename _select_wrapsMike Bayer2015-03-081-1/+1
| | | | | - replace force_result_map with a mini-API for nested result sets, add coverage
* - the change for #918 was of course not nearly that simple.Mike Bayer2015-03-071-1/+2
| | | | | | | | | | | | | | | | | | 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.
* - Custom dialects that implement :class:`.GenericTypeCompiler` canMike Bayer2015-01-161-40/+42
| | | | | | | | | | | | | | 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
* - SQL Server 2012 now recommends VARCHAR(max), NVARCHAR(max),Mike Bayer2014-12-061-9/+96
| | | | | | | VARBINARY(max) for large text/binary types. The MSSQL dialect will now respect this based on version detection, as well as the new ``deprecate_large_types`` flag. fixes #3039
* cleanup exception handling - use new exception hierarchy (since python 2.5)pr/140ndparker2014-10-021-3/+1
|
* improve exception vs. exit handlingndparker2014-09-231-0/+2
|
* - ensure literal_binds works with LIMIT clause, FOR UPDATEMike Bayer2014-09-031-1/+1
|
* - update some SQL server tests, supportMike Bayer2014-07-221-1/+17
| | | | - add support for IDENTITY INSERT setting for INSERT with inline VALUES
* - apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,Brian Jarrett2014-07-201-192/+223
| | | | sqlalchemy/orm, sqlalchemy/event, sqlalchemy/testing
* - Fixed a regression from 0.9.5 caused by :ticket:`3025` where theMike Bayer2014-07-141-0/+3
| | | | | | | query used to determine "default schema" is invalid in SQL Server 2000. For SQL Server 2000 we go back to defaulting to the "schema name" parameter of the dialect, which is configurable but defaults to 'dbo'. fixes #3025
* - Added statement encoding to the "SET IDENTITY_INSERT"Mike Bayer2014-07-141-6/+12
| | | | | | | | | statements which operate when an explicit INSERT is being interjected into an IDENTITY column, to support non-ascii table identifiers on drivers such as pyodbc + unix + py2k that don't support unicode statements. ref #3091 as this fix is also in that issue's patch, but is a different issue.
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-091-1/+2
| | | | to get all flake8 passing
* Merge pull request #98 from abbec/mssql2008-multivalues-insertmike bayer2014-07-061-0/+2
|\ | | | | Fixed support for multivalue inserts for MS SQL 2008
| * - Fixed support for multivalue inserts for MS SQL 2008 since it is actually ↵pr/98Albert Cervin2014-06-161-0/+2
| | | | | | | | supported.
* | - write some really complete docs on MSSQL autoincrement, fixes #3094Mike Bayer2014-06-241-10/+132
|/
* - more tests, including backend testsMike Bayer2014-05-161-17/+34
| | | | - implement for SQL server, use window functions when simple limit/offset not available
* Use _offset_clause and _limit_clause, which are always Visitable and usually ↵Dobes Vandermeer2014-04-251-3/+4
| | | | a BindParameter, instead of _offset and _limit in GenerativeSelect.
* - Revised the query used to determine the current default schema nameMike Bayer2014-04-171-14/+8
| | | | | | | to use the ``database_principal_id()`` function in conjunction with the ``sys.database_principals`` view so that we can determine the default schema independently of the type of login in progress (e.g., SQL Server, Windows, etc). fixes #3025
* - implement kwarg validation and type system for dialect-specificMike Bayer2014-01-181-7/+18
| | | | | arguments; [ticket:2866] - add dialect specific kwarg functionality to ForeignKeyConstraint, ForeignKey
* - changelog for pullreq:11Mike Bayer2014-01-181-1/+1
| | | | - be specific about version 0.9.2
* Bug Fix: Stop generating bad sql if an empty UniqueConstraint() is givendonkopotamus2014-01-171-0/+2
|
* Support mssql_clustered option on UniqueConstraint (plus docs and test)donkopotamus2014-01-171-4/+29
|
* Remove support for mssql_clustered on Tabledonkopotamus2014-01-171-15/+5
|
* Support mssql_clustered option in mssql dialect for both Table and ↵donkopotamus2014-01-141-8/+54
| | | | PrimaryKeyConstraint
* - happy new yearMike Bayer2014-01-051-1/+1
|
* Fix MSSQL dialects visit_drop_index to use the correct DDLdonkopotamus2013-12-051-5/+3
|
* - Fixed bug in default compiler plus those of postgresql, mysql, andMike Bayer2013-10-121-1/+1
| | | | | | | | 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.
* - A rework to the way that "quoted" identifiers are handled, in thatMike Bayer2013-08-271-2/+2
| | | | | | | | | | | | | | | | instead of relying upon various ``quote=True`` flags being passed around, these flags are converted into rich string objects with quoting information included at the point at which they are passed to common schema constructs like :class:`.Table`, :class:`.Column`, etc. This solves the issue of various methods that don't correctly honor the "quote" flag such as :meth:`.Engine.has_table` and related methods. The :class:`.quoted_name` object is a string subclass that can also be used explicitly if needed; the object will hold onto the quoting preferences passed and will also bypass the "name normalization" performed by dialects that standardize on uppercase symbols, such as Oracle, Firebird and DB2. The upshot is that the "uppercase" backends can now work with force-quoted names, such as lowercase-quoted names and new reserved words. [ticket:2812]
* - we dont actually need this unicode cast, on py3k + linux it seems theMike Bayer2013-07-091-7/+1
| | | | | has_table issues are OK. On OSX forget it. - still some issues with PY3k + pyodbc + decimal values it doesn't expect, not sure
* - some tweaks to try to help out mssql+pyodbc support a bit, py3k is reallyMike Bayer2013-06-031-0/+1
| | | | not happening too well (I need to stick with linux + freetds 0.91, I know)
* merge defaultMike Bayer2013-05-151-0/+6
|\
| * Regression from this ticket caused the unsupported keywordMike Bayer2013-05-151-0/+6
| | | | | | | | | | | | "true" to render, added logic to convert this to 1/0 for SQL server. [ticket:2682]
* | plugging awayMike Bayer2013-04-271-3/+3
| |
* | work through dialectsMike Bayer2013-04-271-4/+4
| |
* | - the raw 2to3 runMike Bayer2013-04-271-10/+10
|/ | | | - went through examples/ and cleaned out excess list() calls
* - replace mssql_ordering with generalized #695 solutionMike Bayer2013-01-201-10/+52
| | | | - documentation for mssql index options plus changelog and fixes
* Merged in dharland/sqlalchemy (pull request #35)Mike Bayer2013-01-201-0/+37
|\ | | | | | | Add extra mssql dialect options to Index
| * Add mssql_include option for mssql dialectDerek Harland2013-01-141-0/+10
| |
| * Add mssql_ordering option for mssql dialectDerek Harland2013-01-141-3/+10
| |
| * Add mssql_clustered option for mssql dialectDerek Harland2013-01-141-0/+20
| |
* | :class:`.Index` now supports arbitrary SQL expressions and/orMike Bayer2013-01-161-3/+2
|/ | | | | | | | functions, in addition to straight columns. Common modifiers include using ``somecolumn.desc()`` for a descending index and ``func.lower(somecolumn)`` for a case-insensitive index, depending on the capabilities of the target backend. [ticket:695]
* - changelog for pullreq 32Mike Bayer2013-01-121-124/+10
| | | | | | | | | | | - Fixed a regression whereby the "collation" parameter of the character types CHAR, NCHAR, etc. stopped working, as "collation" is now supported by the base string types. The TEXT, NCHAR, CHAR, VARCHAR types within the MSSQL dialect are now synonyms for the base types. - move out the type rendering tests into DB-agnostic tests and remove some of the old "create" statements. tests here are still very disorganized.
* Merged in dharland/sqlalchemy (pull request #32: Allow the MSSQL dialect to ↵Mike Bayer2013-01-121-12/+11
|\ | | | | | | support identity columns that are not part of the primary key)