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))
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))
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])
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])