Commits

Mike Bayer  committed c24e825

- The firebird dialect will quote identifiers which begin with an
underscore. Courtesy Treeve Jelbert. [ticket:2897]

  • Participants
  • Parent commits ab1ab82
  • Branches rel_0_8

Comments (0)

Files changed (3)

File doc/build/changelog/changelog_08.rst

     .. change::
         :tags: bug, firebird
         :versions: 0.9.0b2
+        :tickets: 2897
+
+        The firebird dialect will quote identifiers which begin with an
+        underscore.  Courtesy Treeve Jelbert.
+
+    .. change::
+        :tags: bug, firebird
+        :versions: 0.9.0b2
 
         Fixed bug in Firebird index reflection where the columns within the
         index were not sorted correctly; they are now sorted

File lib/sqlalchemy/dialects/firebird/base.py

     """Install Firebird specific reserved words."""
 
     reserved_words = RESERVED_WORDS
+    illegal_initial_characters = compiler.ILLEGAL_INITIAL_CHARACTERS.union(['_'])
 
     def __init__(self, dialect):
         super(FBIdentifierPreparer, self).__init__(dialect, omit_schema=True)

File test/dialect/test_firebird.py

         for type_, args, kw, res in columns:
             self.assert_compile(type_(*args, **kw), res)
 
+    def test_quoting_initial_chars(self):
+        self.assert_compile(
+            column("_somecol"),
+            '"_somecol"'
+        )
+        self.assert_compile(
+            column("$somecol"),
+            '"$somecol"'
+        )
 class TypesTest(fixtures.TestBase):
     __only_on__ = 'firebird'