diff roundup/backends/back_sqlite.py @ 1906:f255363e6d97

PostgreSQL backend lands. - that's the postgresql backend in (cleaned up doc, unit testing harness and the backend module itself) - also cleaned up the index maintenance code (actual checks for existence rather than bare-except failure mode)
author Richard Jones <richard@users.sourceforge.net>
date Tue, 11 Nov 2003 11:19:18 +0000
parents 94e430ad4fdb
children f5c804379c85
line wrap: on
line diff
--- a/roundup/backends/back_sqlite.py	Tue Nov 11 00:35:14 2003 +0000
+++ b/roundup/backends/back_sqlite.py	Tue Nov 11 11:19:18 2003 +0000
@@ -1,4 +1,4 @@
-# $Id: back_sqlite.py,v 1.10 2003-10-07 07:17:54 anthonybaxter Exp $
+# $Id: back_sqlite.py,v 1.11 2003-11-11 11:19:18 richard Exp $
 __doc__ = '''
 See https://pysqlite.sourceforge.net/ for pysqlite info
 '''
@@ -106,6 +106,13 @@
             if str(error) != 'cannot commit - no transaction is active':
                 raise
 
+    def sql_index_exists(self, table_name, index_name):
+        self.cursor.execute('pragma index_list(%s)'%table_name)
+        for entry in self.cursor.fetchall():
+            if entry[1] == index_name:
+                return 1
+        return 0
+
     def save_dbschema(self, schema):
         ''' Save the schema definition that the database currently implements
         '''

Roundup Issue Tracker: http://roundup-tracker.org/