Removed references to sequence in MSSQL
Implicit identities in mssql work the same as implicit sequences on any other dialects. Explicit sequences are enabled through the use of "default=Sequence()". See the MSSQL dialect documentation for more information.
This commit is contained in:
parent
e552ce339e
commit
9ae821ee66
5
CHANGES
5
CHANGES
|
@ -519,6 +519,11 @@ CHANGES
|
|||
case, so there's no point in having a flag.
|
||||
- using new dialect.initialize() feature to set up
|
||||
version-dependent behavior.
|
||||
- removed references to sequence which is no longer used.
|
||||
implicit identities in mssql work the same as implicit
|
||||
sequences on any other dialects. Explicit sequences are
|
||||
enabled through the use of "default=Sequence()". See
|
||||
the MSSQL dialect documentation for more information.
|
||||
|
||||
- types
|
||||
- The construction of types within dialects has been totally
|
||||
|
|
|
@ -50,6 +50,11 @@ intersesting:
|
|||
|
||||
RUNNING INDIVIDUAL TESTS
|
||||
-------------------------
|
||||
Any directory of test modules can be run at once by specifying the directory
|
||||
path:
|
||||
|
||||
$ nosetest test/dialect
|
||||
|
||||
Any test module can be run directly by specifying its module name:
|
||||
|
||||
$ nosetests test.orm.test_mapper
|
||||
|
|
|
@ -138,6 +138,9 @@ would yield::
|
|||
Note that the ``start`` and ``increment`` values for sequences are
|
||||
optional and will default to 1,1.
|
||||
|
||||
Implicit ``autoincrement`` behavior works the same in MSSQL as it
|
||||
does in other dialects and results in an ``IDENTITY`` column.
|
||||
|
||||
* Support for ``SET IDENTITY_INSERT ON`` mode (automagic on / off for
|
||||
``INSERT`` s)
|
||||
|
||||
|
@ -1082,7 +1085,7 @@ class MSDDLCompiler(compiler.DDLCompiler):
|
|||
|
||||
# install a IDENTITY Sequence if we have an implicit IDENTITY column
|
||||
if seq_col is column:
|
||||
sequence = getattr(column, 'sequence', None)
|
||||
sequence = isinstance(column.default, sa_schema.Sequence) and column.default
|
||||
if sequence:
|
||||
start, increment = sequence.start or 1, sequence.increment or 1
|
||||
else:
|
||||
|
|
|
@ -300,7 +300,7 @@ class Inspector(object):
|
|||
colargs.append(sa_schema.DefaultClause(sql.text(col_d['default'])))
|
||||
|
||||
if 'sequence' in col_d:
|
||||
# TODO: whos using this ?
|
||||
# TODO: mssql, maxdb and sybase are using this.
|
||||
seq = col_d['sequence']
|
||||
sequence = sa_schema.Sequence(seq['name'], 1, 1)
|
||||
if 'start' in seq:
|
||||
|
|
|
@ -322,8 +322,9 @@ class ReflectionTest(TestBase, ComparesTables):
|
|||
meta2 = MetaData(testing.db)
|
||||
try:
|
||||
table2 = Table('identity_test', meta2, autoload=True)
|
||||
assert table2.c['col1'].sequence.start == 2
|
||||
assert table2.c['col1'].sequence.increment == 3
|
||||
sequence = isinstance(table2.c['col1'].default, schema.Sequence) and table2.c['col1'].default
|
||||
assert sequence.start == 2
|
||||
assert sequence.increment == 3
|
||||
finally:
|
||||
table.drop()
|
||||
|
||||
|
@ -799,7 +800,7 @@ class TypesTest(TestBase, AssertsExecutionResults, ComparesTables):
|
|||
(types.Time, [], {},
|
||||
'DATETIME', ['<', (10,)], mssql.MSDateTime),
|
||||
(mssql.MSTime, [], {},
|
||||
'DATETIME', ['<', (10,)], mssql.MSDateTime),
|
||||
'TIME', ['>=', (10,)]),
|
||||
|
||||
(mssql.MSSmallDateTime, [], {},
|
||||
'SMALLDATETIME', []),
|
||||
|
|
Loading…
Reference in New Issue