summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/firebird
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2009-12-06 22:58:05 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2009-12-06 22:58:05 +0000
commit7dc4df8a68eafd406e7378eedbb9c26188611a5c (patch)
tree89c6c1d5d7559155e07eeed6545e3362675d685c /lib/sqlalchemy/dialects/firebird
parentf9cb6f5834fb1acf4460fd9bb6b72f8c76f8c36c (diff)
downloadsqlalchemy-7dc4df8a68eafd406e7378eedbb9c26188611a5c.tar.gz
- The Boolean type, when used on a backend that doesn't
have native boolean support, will generate a CHECK constraint "col IN (0, 1)" along with the int/smallint- based column type. This can be switched off if desired with create_constraint=False. Note that MySQL has no native boolean *or* CHECK constraint support so this feature isn't available on that platform. [ticket:1589]
Diffstat (limited to 'lib/sqlalchemy/dialects/firebird')
-rw-r--r--lib/sqlalchemy/dialects/firebird/base.py27
1 files changed, 4 insertions, 23 deletions
diff --git a/lib/sqlalchemy/dialects/firebird/base.py b/lib/sqlalchemy/dialects/firebird/base.py
index 21fec6b51..86d6876a6 100644
--- a/lib/sqlalchemy/dialects/firebird/base.py
+++ b/lib/sqlalchemy/dialects/firebird/base.py
@@ -123,29 +123,7 @@ RESERVED_WORDS = set([
])
-class _FBBoolean(sqltypes.Boolean):
- def result_processor(self, dialect, coltype):
- def process(value):
- if value is None:
- return None
- return value and True or False
- return process
-
- def bind_processor(self, dialect):
- def process(value):
- if value is True:
- return 1
- elif value is False:
- return 0
- elif value is None:
- return None
- else:
- return value and True or False
- return process
-
-
colspecs = {
- sqltypes.Boolean: _FBBoolean,
}
ischema_names = {
@@ -321,10 +299,13 @@ class FBDialect(default.DefaultDialect):
sequences_optional = False
supports_default_values = True
postfetch_lastrowid = False
-
+
+ supports_native_boolean = False
+
requires_name_normalize = True
supports_empty_insert = False
+
statement_compiler = FBCompiler
ddl_compiler = FBDDLCompiler
preparer = FBIdentifierPreparer