示例#1
0
 def _insert(self, feature, cursor):
     """
     Insert a feature into the database.
     """
     try:
         cursor.execute(constants._INSERT, feature.astuple())
     except sqlite3.ProgrammingError:
         cursor.execute(constants._INSERT, feature.astuple(self.default_encoding))
示例#2
0
 def _insert(self, feature, cursor):
     """
     Insert a feature into the database.
     """
     try:
         cursor.execute(constants._INSERT, feature.astuple())
     except sqlite3.ProgrammingError:
         cursor.execute(
             constants._INSERT, feature.astuple(self.default_encoding))
示例#3
0
 def _replace(self, feature, cursor):
     """
     Insert a feature into the database.
     """
     try:
         cursor.execute(constants._UPDATE,
                        list(feature.astuple()) + [feature.id])
     except sqlite3.ProgrammingError:
         cursor.execute(
             constants._INSERT,
             list(feature.astuple(self.default_encoding)) + [feature.id])
示例#4
0
 def _replace(self, feature, cursor):
     """
     Insert a feature into the database.
     """
     try:
         cursor.execute(
             constants._UPDATE,
             list(feature.astuple()) + [feature.id])
     except sqlite3.ProgrammingError:
         cursor.execute(
             constants._INSERT,
             list(feature.astuple(self.default_encoding)) + [feature.id])