]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Correcting options name from withoids to with_oids
authorMalik Diarra <malik.diarra@gmail.com>
Sun, 17 Aug 2014 00:48:21 +0000 (02:48 +0200)
committerMalik Diarra <malik.diarra@gmail.com>
Sun, 17 Aug 2014 00:48:21 +0000 (02:48 +0200)
lib/sqlalchemy/dialects/postgresql/base.py
test/dialect/postgresql/test_compiler.py

index b09eaba725b7171429789695edc2fd2ab1ef2c44..057a5e07271af65548e52304e4a41a4360af0646 100644 (file)
@@ -1450,8 +1450,8 @@ class PGDDLCompiler(compiler.DDLCompiler):
 
     def post_create_table(self, table):
         table_opts = []
-        if table.dialect_options['postgresql']['withoids'] is not None:
-            if table.dialect_options['postgresql']['withoids']:
+        if table.dialect_options['postgresql']['with_oids'] is not None:
+            if table.dialect_options['postgresql']['with_oids']:
                 table_opts.append('WITH OIDS')
             else:
                 table_opts.append('WITHOUT OIDS')
@@ -1725,7 +1725,7 @@ class PGDialect(default.DefaultDialect):
         (schema.Table, {
             "ignore_search_path": False,
             "tablespace": None,
-            "withoids" : None,
+            "with_oids" : None,
             "on_commit" : None,
         })
     ]
index e4a8c02eb0c3cf3dfd75a10199c139d3e4bfbb76..5d1fddb49f42cb070d855f5fb950bc8d4bad1123 100644 (file)
@@ -179,11 +179,11 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
 
     def test_create_table_with_oids(self):
         m = MetaData()
-        tbl = Table('atable', m, Column("id", Integer), postgresql_withoids = True, )
+        tbl = Table('atable', m, Column("id", Integer), postgresql_with_oids = True, )
         self.assert_compile(schema.CreateTable(tbl),
                 "CREATE TABLE atable (id INTEGER)WITH OIDS")
 
-        tbl2 = Table('anothertable', m, Column("id", Integer), postgresql_withoids = False, )
+        tbl2 = Table('anothertable', m, Column("id", Integer), postgresql_with_oids = False, )
         self.assert_compile(schema.CreateTable(tbl2),
                 "CREATE TABLE anothertable (id INTEGER)WITHOUT OIDS")
 
@@ -195,7 +195,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
     
     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")
+        tbl = Table('atable', m, Column("id", Integer), postgresql_tablespace = 'sometablespace', postgresql_with_oids = 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")