summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mssql/base.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Use separate label generator for column_label naming conventionMike Bayer2019-10-141-3/+3
| | | | | | | | | | | | | | | | | | | | Fixed bug where a table that would have a column label overlap with a plain column name, such as "foo.id AS foo_id" vs. "foo.foo_id", would prematurely generate the ``._label`` attribute for a column before this overlap could be detected due to the use of the ``index=True`` or ``unique=True`` flag on the column in conjunction with the default naming convention of ``"column_0_label"``. This would then lead to failures when ``._label`` were used later to generate a bound parameter name, in particular those used by the ORM when generating the WHERE clause for an UPDATE statement. The issue has been fixed by using an alternate ``._label`` accessor for DDL generation that does not affect the state of the :class:`.Column`. The accessor also bypasses the key-deduplication step as it is not necessary for DDL, the naming is now consistently ``"<tablename>_<columnname>"`` without any subsequent numeric symbols when used in DDL. Fixes: #4911 Change-Id: Iabf5fd3250738d800d6e41a2a3a27a7ce2405e7d
* Fix max_identifier_length for SQL serverMike Bayer2019-10-071-4/+0
| | | | | | | | | Fixed bug in SQL Server dialect with new "max_identifier_length" feature where the mssql dialect already featured this flag, and the implementation did not accommodate for the new initialization hook correctly. Fixes: #4857 Change-Id: I96a9c6ca9549d8f6fb167c0333f684e8d922a3bf
* Merge "Deprecate textual column matching in Row"mike bayer2019-10-051-1/+18
|\
| * Deprecate textual column matching in RowMike Bayer2019-10-041-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deprecate query.instances() without a context Deprecate string alias with contains_eager() Deprecated the behavior by which a :class:`.Column` can be used as the key in a result set row lookup, when that :class:`.Column` is not part of the SQL selectable that is being selected; that is, it is only matched on name. A deprecation warning is now emitted for this case. Various ORM use cases, such as those involving :func:`.text` constructs, have been improved so that this fallback logic is avoided in most cases. Calling the :meth:`.Query.instances` method without passing a :class:`.QueryContext` is deprecated. The original use case for this was that a :class:`.Query` could yield ORM objects when given only the entities to be selected as well as a DBAPI cursor object. However, for this to work correctly there is essential metadata that is passed from a SQLAlchemy :class:`.ResultProxy` that is derived from the mapped column expressions, which comes originally from the :class:`.QueryContext`. To retrieve ORM results from arbitrary SELECT statements, the :meth:`.Query.from_statement` method should be used. Note there is a small bump in test_zoomark because the column._label is being calculated for each of those columns within baseline_3_properties, as it is now part of the result map. This label can't be calculated when the column is attached to the table because it needs to have all the columns present to do this correctly. Another approach here would be to pre-load the _label before the test runs however the zoomark tests don't have an easy place for this to happen and it's not really worth it. Fixes: #4877 Fixes: #4719 Change-Id: I9bd29e72e6dce7c855651d69ba68d7383469acbc
* | Apply quoting to SQL Server _switch_dbMike Bayer2019-10-031-3/+12
|/ | | | | | | | | | | | | Added identifier quoting to the schema name applied to the "use" statement which is invoked when a SQL Server multipart schema name is used within a :class:`.Table` that is being reflected, as well as for :class:`.Inspector` methods such as :meth:`.Inspector.get_table_names`; this accommodates for special characters or spaces in the database name. Additionally, the "use" statement is not emitted if the current database matches the target owner database name being passed. Fixes: #4883 Change-Id: I84419730e94aac3a88d331ad8c24d10aabbc34af
* Unify generation between Core and ORM queryMike Bayer2019-09-261-3/+3
| | | | | | | | | | | | | | generation is to be enhanced to include caching functionality, so ensure that Query and all generative in Core (e.g. select, DML etc) are using the same generations system. Additionally, deprecate Select.append methods and state Select methods independently of their append versions. Mutability of expression objects is a special case only when generating new objects during a visit. Fixes: #4637 Change-Id: I3dfac00d5e0f710c833b236f7a0913e1ca24dde4
* add SQL Server 2017 to mssql/base.py - Fixes #4833Gord Thompson2019-09-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ### Description Add version 14 for SQL Server 2017 to mssql/base.py Fixes #4833 ### Checklist <!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once) --> This pull request is: - [ ] A documentation / typographical error fix - Good to go, no issue or tests are needed - [x] A short code fix - please include the issue number, and create an issue if none exists, which must include a complete example of the issue. one line code fixes without an issue and demonstration will not be accepted. - Please include: `Fixes: #<issue number>` in the commit message - please include tests. one line code fixes without tests will not be accepted. - [ ] A new feature implementation - please include the issue number, and create an issue if none exists, which must include a complete example of how the feature would look. - Please include: `Fixes: #<issue number>` in the commit message - please include tests. Closes: #4832 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4832 Pull-request-sha: 3d72335284fd585c40b961bbc7013e53f3874cb5 Change-Id: Ib53a938a22386aab9e603048753cd2966c5d2b33
* Render LIMIT/OFFSET conditions after compile on select dialectsMike Bayer2019-08-301-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added new "post compile parameters" feature. This feature allows a :func:`.bindparam` construct to have its value rendered into the SQL string before being passed to the DBAPI driver, but after the compilation step, using the "literal render" feature of the compiler. The immediate rationale for this feature is to support LIMIT/OFFSET schemes that don't work or perform well as bound parameters handled by the database driver, while still allowing for SQLAlchemy SQL constructs to be cacheable in their compiled form. The immediate targets for the new feature are the "TOP N" clause used by SQL Server (and Sybase) which does not support a bound parameter, as well as the "ROWNUM" and optional "FIRST_ROWS()" schemes used by the Oracle dialect, the former of which has been known to perform better without bound parameters and the latter of which does not support a bound parameter. The feature builds upon the mechanisms first developed to support "expanding" parameters for IN expressions. As part of this feature, the Oracle ``use_binds_for_limits`` feature is turned on unconditionally and this flag is now deprecated. - adds limited support for "unique" bound parameters within a text() construct. - adds an additional int() check within the literal render function of the Integer datatype and tests that non-int values raise ValueError. Fixes: #4808 Change-Id: Iace97d544d1a7351ee07db970c6bc06a19c712c6
* Add support for try_cast function on sqlalchemy.dialects.mssqlLeonel Atencio2019-08-121-0/+42
| | | | | | | | | | | | Added new :func:`.mssql.try_cast` construct for SQL Server which emits "TRY_CAST" syntax. Pull request courtesy Leonel Atencio. Fixes: #4782 Closes: #4785 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4785 Pull-request-sha: cf13303a9d1c0cc0233a82a5d2ca01f438b6fb9b Change-Id: I74a71ff5e587353f67472534aabe0d54ae8039ae
* SelectBase no longer a FromClauseMike Bayer2019-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | As part of the SQLAlchemy 2.0 migration project, a conceptual change has been made to the role of the :class:`.SelectBase` class hierarchy, which is the root of all "SELECT" statement constructs, in that they no longer serve directly as FROM clauses, that is, they no longer subclass :class:`.FromClause`. For end users, the change mostly means that any placement of a :func:`.select` construct in the FROM clause of another :func:`.select` requires first that it be wrapped in a subquery first, which historically is through the use of the :meth:`.SelectBase.alias` method, and is now also available through the use of :meth:`.SelectBase.subquery`. This was usually a requirement in any case since several databases don't accept unnamed SELECT subqueries in their FROM clause in any case. See the documentation in this change for lots more detail. Fixes: #4617 Change-Id: I0f6174ee24b9a1a4529168e52e855e12abd60667
* CAST bind values against SQL Server sys into NVARCHARMike Bayer2019-06-281-6/+6
| | | | | | | | | | | | | | | Ensured that the queries used to reflect indexes and view definitions will explicitly CAST string parameters into NVARCHAR, as many SQL Server drivers frequently treat string values, particularly those with non-ascii characters or larger string values, as TEXT which often don't compare correctly against VARCHAR characters in SQL Server's information schema tables for some reason. These CAST operations already take place for reflection queries against SQL Server ``information_schema.`` tables but were missing from three additional queries that are against ``sys.`` tables. Fixes: #4745 Change-Id: I3056533bf1a1e8ef17742879d369ab13f8b704ea
* Enable F841Mike Bayer2019-06-201-1/+0
| | | | | | | | | | | This is a very useful assertion which prevents unused variables from being set up allows code to be more readable and sometimes even more efficient. test suites seem to be where the most problems are and there do not seem to be documentation examples that are using this, or at least the linter is not taking effect within rst blocks. Change-Id: I2b3341d8dd14da34879d8425838e66a4b9f8e27d
* Reverse Alias nesting conceptMike Bayer2019-06-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The Alias object no longer has "element" and "original", it now has "wrapped" and "element" (the name .original is also left as a descriptor for legacy access by third party dialects). These two data members refer to the dual roles Alias needs to play, where in the Python sense it needs to refer to the thing it was applied against directly, whereas in the SQL sense it needs to refer to the ultimate "non-alias" thing it refers towards. Both are necessary to maintain. However, the change here has each Alias object access the non-Alias object immediately so that the "unwrapping" is simpler and does not need any special logic. In the SQL sense, Alias objects don't nest, the only potential was that of the CTE, however there is no such thing as a nested CTE, see link below. This change is an interim change along the way to breaking Alias into more classes and breaking away Select objects from being FromClause objects. Change-Id: Ie7a0d064226cb074ca745505129b5ec7d879e389 References: https://stackoverflow.com/questions/1413516/can-you-create-nested-with-clauses-for-common-table-expressions
* Implement new ClauseElement role and coercion systemMike Bayer2019-05-181-3/+2
| | | | | | | | | | | | | | | | | | | | A major refactoring of all the functions handle all detection of Core argument types as well as perform coercions into a new class hierarchy based on "roles", each of which identify a syntactical location within a SQL statement. In contrast to the ClauseElement hierarchy that identifies "what" each object is syntactically, the SQLRole hierarchy identifies the "where does it go" of each object syntactically. From this we define a consistent type checking and coercion system that establishes well defined behviors. This is a breakout of the patch that is reorganizing select() constructs to no longer be in the FromClause hierarchy. Also includes a rename of as_scalar() into scalar_subquery(); deprecates automatic coercion to scalar_subquery(). Partially-fixes: #4617 Change-Id: I26f1e78898693c6b99ef7ea2f4e7dfd0e8e1a1bd
* Add support for filtered indexes for mssql dialectmollardthomas2019-05-061-1/+23
| | | | | | | | | | | | | Added support for SQL Server filtered indexes, via the ``mssql_where`` parameter which works similarly to that of the ``postgresql_where`` index function in the PostgreSQL dialect. Fixes: #4657 Closes: #4658 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4658 Pull-request-sha: cf609c19bccc74c0dba38d2fc4976df3a205f3f6 Change-Id: I9c61b97d0b0cb6f6d417da7b1875b40f8f918a3c
* MSSQL: only compile ORDER BY if it will be renderedMatt Lewellyn2019-04-041-2/+8
| | | | | | | | | | | | | | | Fixed issue in SQL Server dialect where if a bound parameter were present in an ORDER BY expression that would ultimately not be rendered in the SQL Server version of the statement, the parameters would still be part of the execution parameters, leading to DBAPI-level errors. Pull request courtesy Matt Lewellyn. Fixes: #4587 Closes: #4588 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4588 Pull-request-sha: 2992a473e0f6d4fc27794cfd949ba20a81fad2ca Change-Id: Ie709aefdb1babf810bb81526289448f8cc7a4cb1
* Commit transaction after SNAPSHOT isolation changeMike Bayer2019-03-081-0/+2
| | | | | | | | | A commit() is emitted after an isolation level change to SNAPSHOT, as both pyodbc and pymssql open an implicit transaction which blocks subsequent SQL from being emitted in the current transaction. Fixes: #4536 Change-Id: If3ba70f495bce2a35a873a3a72d1b30406e678c8
* Ensure scale param not sent to float typesMike Bayer2019-03-061-7/+8
| | | | | | | | | Fixed regression in SQL Server reflection due to :ticket:`4393` where the removal of open-ended ``**kw`` from the :class:`.Float` datatype caused reflection of this type to fail due to a "scale" argument being passed. Fixes: #4525 Change-Id: Ief8bb535778055eff2ab0d71660f81e3676390a1
* Set IDENTITY_INSERT for insert.values({column: expr})Mike Bayer2019-02-131-4/+12
| | | | | | | | | | Fixed bug where the SQL Server "IDENTITY_INSERT" logic that allows an INSERT to proceed with an explicit value on an IDENTITY column was not detecting the case where :meth:`.Insert.values` were used with a dictionary that contained a :class:`.Column` as key and a SQL expression as a value. Fixes: #4499 Change-Id: Ia61cd6524b030b40a665db9c20771f0c5aa5fcd7
* Fix many spell glitchesLele Gaifax2019-01-251-1/+1
| | | | | | | | | | | | This affects mostly docstrings, except in orm/events.py::dispose_collection() where one parameter gets renamed: given that the method is empty, it seemed reasonable to me to fix that too. Closes: #4440 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4440 Pull-request-sha: 779ed75acb6142e1f1daac467b5b14134529bb4b Change-Id: Ic0553fe97853054b09c2453af76d96363de6eb0e
* Fix mssql quote schema warningMike Bayer2019-01-251-5/+15
| | | | | | | | | The deprecations review didn't include tests of identifier_preparer.quote.force for backends, so MSSQL slipped through. We have to fully reimplement the deprecation warning here so that it passes tests which are now enabled for all backends. Change-Id: I9d07e6766e16b5a35b7f7566f1daf94b04346270
* Add deprecation warnings to all deprecated APIsMike Bayer2019-01-231-18/+6
| | | | | | | | | | | | | | | A large change throughout the library has ensured that all objects, parameters, and behaviors which have been noted as deprecated or legacy now emit ``DeprecationWarning`` warnings when invoked. As the Python 3 interpreter now defaults to displaying deprecation warnings, as well as that modern test suites based on tools like tox and pytest tend to display deprecation warnings, this change should make it easier to note what API features are obsolete. See the notes added to the changelog and migration notes for further details. Fixes: #4393 Change-Id: If0ea11a1fc24f9a8029352eeadfc49a7a54c0a1b
* Repair use of deprecated text() typemap, bindparams parametersMike Bayer2019-01-171-35/+28
| | | | | | | | These will emit a deprecation warning once If0ea11a1fc24f9a8029352eeadfc49a7a54c0a1b is merged, modernize these ahead of time as this should likely be backported to 1.2 as well. Change-Id: Iae4426a856d5617e8a325b14d8b6fc22333f2cda
* Merge "Render N'' for SQL Server unicode literals"mike bayer2019-01-151-4/+20
|\
| * Render N'' for SQL Server unicode literalsMike Bayer2019-01-151-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ``literal_processor`` for the :class:`.Unicode` and :class:`.UnicodeText` datatypes now render an ``N`` character in front of the literal string expression as required by SQL Server for Unicode string values rendered in SQL expressions. Note that this adds full unicode characters to the standard test suite, which means we also need to bump MySQL provisioning up to utf8mb4. Modern installs do not seem to be reproducing the 1271 issue locally, if it reproduces in CI it would be better for us to skip those ORM-centric tests for MySQL. Also remove unused _StringType from SQL Server dialect Fixes: #4442 Change-Id: Id55817b3e8a2d81ddc8b7b27f85e3f1dcc1cea7e
* | Remove version directives for 0.6, 0.7, 0.8Mike Bayer2019-01-151-7/+0
|/ | | | | | | | | - fix a few "seealso"s - ComparableProprerty's "superseded in 0.7" becomes deprecated in 0.7 Backport to currently maintained doc versions 1.2, 1.1 Change-Id: Ib1fcb2df8673dbe5c4ffc47f3896a60d1dfcb4b2
* Merge "use ..deprecated directive w/ version in all cases"mike bayer2019-01-121-1/+6
|\
| * use ..deprecated directive w/ version in all casesMike Bayer2019-01-111-1/+6
| | | | | | | | | | | | | | | | | | These changes should be ported from 1.3 back to 1.0 or possibly 0.9 to the extent they are relevant in each version. In 1.3 we hope to turn all deprecation documentation into warnings. Change-Id: I205186cde161af9389af513a425c62ce90dd54d8
* | happy new yearMike Bayer2019-01-111-1/+1
|/ | | | Change-Id: I6a71f4924d046cf306961c58dffccf21e9c03911
* Post black reformattingMike Bayer2019-01-061-38/+43
| | | | | | | | | | | | | Applied on top of a pure run of black -l 79 in I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9, this set of changes resolves all remaining flake8 conditions for those codes we have enabled in setup.cfg. Included are resolutions for all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I4f72d3ba1380dd601610ff80b8fb06a2aff8b0fe
* Run black -l 79 against all source filesMike Bayer2019-01-061-467/+771
| | | | | | | | | | | | | | This is a straight reformat run using black as is, with no edits applied at all. The black run will format code consistently, however in some cases that are prevalent in SQLAlchemy code it produces too-long lines. The too-long lines will be resolved in the following commit that will resolve all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9
* Add new parameters for IDENTITY start/increment in mssqlMike Bayer2018-11-141-37/+97
| | | | | | | | | | | Deprecated the use of :class:`.Sequence` with SQL Server in order to affect the "start" and "increment" of the IDENTITY value, in favor of new parameters ``mssql_identity_start`` and ``mssql_identity_increment`` which set these parameters directly. :class:`.Sequence` will be used to generate real ``CREATE SEQUENCE`` DDL with SQL Server in a future release. Fixes: #4362 Change-Id: I1e69378c5c960ff0bc28137c923589692f1a918f
* Add support of empty list in exanding of bindparamNicolas Rolin2018-08-071-0/+3
| | | | | | | | | | | Added new logic to the "expanding IN" bound parameter feature whereby if the given list is empty, a special "empty set" expression that is specific to different backends is generated, thus allowing IN expressions to be fully dynamic including empty IN expressions. Fixes: #4271 Change-Id: Icc3c73bbd6005206b9d06baaeb14a097af5edd36 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/432
* Add unique_constraint_name to MSSQL FK reflectionSean Dunn2018-06-291-0/+2
| | | | | | | | | | | Fixed bug in MSSQL reflection where when two same-named tables in different schemas had same-named primary key constraints, foreign key constraints referring to one of the tables would have their columns doubled, causing errors. Pull request courtesy Sean Dunn. Fixes: #4228 Change-Id: I7dabaaee0944e1030048826ba39fc574b0d63031 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/457
* Fix UnboundLocalError in mssql during isolation level grabMike Bayer2018-06-251-7/+12
| | | | | | | | | | | | Fixed issue within the SQL Server dialect under Python 3 where when running against a non-standard SQL server database that does not contain either the "sys.dm_exec_sessions" or "sys.dm_pdw_nodes_exec_sessions" views, leading to a failure to fetch the isolation level, the error raise would fail due to an UnboundLocalError. Fixes: #4273 Co-authored-by: wikiped <wikiped@yandex.ru> Change-Id: I39877c1f65f9cf8602fb1dceaf03072357759564
* SQL Server is not native boolean; add new flag for CHECK constraintMike Bayer2018-05-101-1/+2
| | | | | | | | | | | | | | Fixed a 1.2 regression caused by :ticket:`4061` where the SQL Server "BIT" type would be considered to be "native boolean". The goal here was to avoid creating a CHECK constraint on the column, however the bigger issue is that the BIT value does not behave like a true/false constant and cannot be interpreted as a standalone expression, e.g. "WHERE <column>". The SQL Server dialect now goes back to being non-native boolean, but with an extra flag that still avoids creating the CHECK constraint. Change-Id: I4765d2a2a00b0d14f50282603cc4d48d4739dac1 Fixes: #4250
* Correct join for FKs with schema in SQL ServerMike Bayer2018-04-111-1/+1
| | | | | | | | | | | | | Fixed 1.2 regression caused by :ticket:`4060` where the query used to reflect SQL Server cross-schema foreign keys was limiting the criteria incorrectly. Additionally, added some rework of the inter-schema reflection tests so that MySQL, MSSQL can be included, breaking out some of the Postgresql-specific behaviors into separate requirements. Fixes: #4234 Change-Id: I20c8e70707075f1767b79127c2c27d4b313c6515
* Merge "Make column-level collation quoting dialect-specific"mike bayer2018-01-121-3/+3
|\
| * Make column-level collation quoting dialect-specificMike Bayer2018-01-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixed regression in 1.2 where newly repaired quoting of collation names in :ticket:`3785` breaks SQL Server, which explicitly does not understand a quoted collation name. Whether or not mixed-case collation names are quoted or not is now deferred down to a dialect-level decision so that each dialect can prepare these identifiers directly. Change-Id: Iaf0a8123d9bf4711219e320896bb28c5d2649304 Fixes: #4154
* | happy new yearMike Bayer2018-01-121-1/+1
|/ | | | Change-Id: I3ef36bfd0cb0ba62b3123c8cf92370a43156cf8f
* Allow delete where clause to refer multiple tables.inytar2017-12-051-0/+22
| | | | | | | | | | | | | | | | | | | | | Implemented "DELETE..FROM" syntax for Postgresql, MySQL, MS SQL Server (as well as within the unsupported Sybase dialect) in a manner similar to how "UPDATE..FROM" works. A DELETE statement that refers to more than one table will switch into "multi-table" mode and render the appropriate "USING" or multi-table "FROM" clause as understood by the database. Pull request courtesy Pieter Mulder. For SQL syntaxes see: Postgresql: https://www.postgresql.org/docs/current/static/sql-delete.html MySQL: https://dev.mysql.com/doc/refman/5.7/en/delete.html#multiple-table_syntax MSSQL: https://docs.microsoft.com/en-us/sql/t-sql/statements/delete-transact-sql Sybase: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc00801.1510/html/iqrefso/X315721.htm Co-authored by: Mike Bayer <mike_mp@zzzcomputing.com> Change-Id: I6dfd57b49e44a095d076dc493cd2360bb5d920d3 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/392 Fixes: #959
* Fix / consolidate for SQL Server BINARY, VARBINARYBen Shen2017-10-251-5/+4
| | | | | | | | | | | | Fixed bug where sqltypes.BINARY and sqltypes.VARBINARY datatypes would not include correct bound-value handlers for pyodbc, which allows the pyodbc.NullParam value to be passed that helps with FreeTDS. Co-authored by: Mike Bayer <mike_mp@zzzcomputing.com> Change-Id: I6e3c16a69465b4fbc7b17a1927fb5e66acee93cb Pull-request: https://github.com/zzzeek/sqlalchemy/pull/386 Fixes: #4121
* Add SQL Server TIMESTAMP / ROWVERSION datatypesMike Bayer2017-10-041-1/+77
| | | | | | | | | | | | | SQL Server has an entirely different use for the TIMESTAMP datatype that is unrelated to the SQL standard's version of this type. It is a read-only type that returns an incrementing binary value. The ROWVERSION name will supersede the TIMESTAMP name. Implement datatype objects for both, separate from the base DateTime/TIMESTAMP class hierarchy, and also implement an optional integer coercion feature. Change-Id: Ie2bd43b7aac57760b8ec6ff6e26460e2086a95eb Fixes: #4086
* Add SQL Server CI coverageMike Bayer2017-08-311-22/+15
| | | | Change-Id: Ida0d01ae9bcc0573b86e24fddea620a38c962822
* Enable native boolean for SQL ServerMike Bayer2017-08-301-1/+1
| | | | | | | | | | | | | | | | SQL Server supports what SQLAlchemy calls "native boolean" with its BIT type, as this type only accepts 0 or 1 and the DBAPIs return its value as True/False. So the SQL Server dialects now enable "native boolean" support, in that a CHECK constraint is not generated for a :class:`.Boolean` datatype. The only difference vs. other native boolean is that there are no "true" / "false" constants so "1" and "0" are still rendered here. Tests are implicit in the existing suites. Change-Id: I75bbcd549884099fb1a177e68667bf880c40fa7c Fixes: #4061
* Merge "Join key_constraints on schema as well for SQL server get_fks"mike bayer2017-08-301-0/+1
|\
| * Join key_constraints on schema as well for SQL server get_fksMike Bayer2017-08-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fixed bug where the SQL Server dialect could pull columns from multiple schemas when reflecting a self-referential foreign key constraint, if multiple schemas contained a constraint of the same name against a table of the same name. Tests are part of standard suite already (CI has been disabled) Change-Id: I04ff4a5dea9b82c8e517b3700a28fe994b5550f3 Fixes: #4060
* | Ignore SQL Server "heap" indexesMike Bayer2017-08-301-1/+1
|/ | | | | | | | | | | Added a rule to SQL Server index reflection to ignore the so-called "heap" index that is implicitly present on a table that does not specify a clustered index. Tests are part of standard suite already (CI has been disabled) Change-Id: I593b95551c40ee5d95d54203611112cbff10856f Fixes: #4059
* Implement AUTOCOMMIT for pyodbc, pymssqlMike Bayer2017-08-291-0/+2
| | | | | | | In prep for CI coverage for SQL Server, allow AUTOCOMMIT isolation level to work Change-Id: I850b977e75f53385986f2c181be4e4412dd3b3f4
* Add placeholder XML supportMike Bayer2017-05-261-0/+18
| | | | | | | | | | | Added a placeholder type :class:`.mssql.XML` to the SQL Server dialect, so that a reflected table which includes this type can be re-rendered as a CREATE TABLE. The type has no special round-trip behavior nor does it currently support additional qualifying arguments. Change-Id: I651fa729bd8e9b31a0b5effe0839aff077d77c46 Fixes: #3973