def quote_schema(self, schema, force=None):
"""Prepare a quoted table and schema name."""
+ # need to re-implement the deprecation warning entirely
+ if force is not None:
+ # not using the util.deprecated_params() decorator in this
+ # case because of the additional function call overhead on this
+ # very performance-critical spot.
+ util.warn_deprecated(
+ "The IdentifierPreparer.quote_schema.force parameter is "
+ "deprecated and will be removed in a future release. This "
+ "flag has no effect on the behavior of the "
+ "IdentifierPreparer.quote method; please refer to "
+ "quoted_name()."
+ )
+
dbname, owner = _schema_elements(schema)
if dbname:
- result = "%s.%s" % (
- self.quote(dbname, force),
- self.quote(owner, force),
- )
+ result = "%s.%s" % (self.quote(dbname), self.quote(owner))
elif owner:
- result = self.quote(owner, force)
+ result = self.quote(owner)
else:
result = ""
return result
class TableDDLTest(fixtures.TestBase):
__backend__ = True
- def _simple_fixture(self):
+ def _simple_fixture(self, schema=None):
return Table(
"test_table",
self.metadata,
Column("id", Integer, primary_key=True, autoincrement=False),
Column("data", String(50)),
+ schema=schema,
)
def _underscore_fixture(self):
table.create(config.db, checkfirst=False)
self._simple_roundtrip(table)
+ @requirements.create_table
+ @util.provide_metadata
+ def test_create_table_schema(self):
+ table = self._simple_fixture(schema=config.test_schema)
+ table.create(config.db, checkfirst=False)
+ self._simple_roundtrip(table)
+
@requirements.drop_table
@util.provide_metadata
def test_drop_table(self):