diff options
author | Malik Diarra <malik.diarra@gmail.com> | 2014-08-17 00:39:36 +0200 |
---|---|---|
committer | Malik Diarra <malik.diarra@gmail.com> | 2014-08-17 01:56:02 +0200 |
commit | d6873904c40134df787ffe5459d61d3663bf5d5f (patch) | |
tree | 12f24e9447ae25d48490d94d42b0cd5224faf5d8 /test/dialect/postgresql/test_compiler.py | |
parent | ef6042ff461e490c2a3040f18f0a3688b2e601a0 (diff) | |
download | sqlalchemy-d6873904c40134df787ffe5459d61d3663bf5d5f.tar.gz |
Adding oids and on_commit table options
Diffstat (limited to 'test/dialect/postgresql/test_compiler.py')
-rw-r--r-- | test/dialect/postgresql/test_compiler.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py index 301f80fd4..b439ab916 100644 --- a/test/dialect/postgresql/test_compiler.py +++ b/test/dialect/postgresql/test_compiler.py @@ -172,6 +172,28 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): self.assert_compile(schema.CreateTable(tbl), "CREATE TABLE atable (id INTEGER)TABLESPACE sometablespace") + def test_create_table_with_oids(self): + m = MetaData() + tbl = Table('atable', m, Column("id", Integer), postgresql_withoids = True, ) + self.assert_compile(schema.CreateTable(tbl), + "CREATE TABLE atable (id INTEGER)WITH OIDS") + + tbl2 = Table('anothertable', m, Column("id", Integer), postgresql_withoids = False, ) + self.assert_compile(schema.CreateTable(tbl2), + "CREATE TABLE anothertable (id INTEGER)WITHOUT OIDS") + + def create_table_with_oncommit_option(self): + m = MetaData() + tbl = Table('atable', m, Column("id", Integer), postgresql_on_commit = "drop") + self.assert_compile(schema.CreateTable(tbl), + "CREATE TABLE atable (id INTEGER) ON COMMIT DROP") + + def create_table_with_multiple_options(self): + m = MetaData() + tbl = Table('atable', m, Column("id", Integer), postgresql_tablespace = 'sometablespace', postgresql_withoids = False, postgresql_on_commit = "preserve_rows") + self.assert_compile(schema.CreateTable(tbl), + "CREATE TABLE atable (id INTEGER)WITHOUT OIDS ON COMMIT PRESERVE ROWS TABLESPACE sometablespace") + def test_create_partial_index(self): m = MetaData() tbl = Table('testtbl', m, Column('data', Integer)) |