Mercurial > p > roundup > code
diff roundup/backends/rdbms_common.py @ 2093:3f6024ab2c7a
That's the last of the RDBMS migration steps done! Yay!
Note that the code currently has some unit testing issues:
- Metakit needs some attention in a couple of areas
- RDBMS backends are having trouble ordering their journal entries
correctly. I'm going to be migrating them to use TIMESTAMP for the date
column, but that's not necessarily going to fix things as mysql and
postgresql both appear to have second granularity. Sqlite will ignore
the data type as usual ;)
Next up is the datatype-ification of the RDBMS backends. Part of that will
involve the migration to numeric IDs, which will also be done in the *dbm
backends (already done in metakit). The ID exposed *above* the hyperdb
will be String, since so many things assume a string ID now.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Sun, 21 Mar 2004 23:39:08 +0000 |
| parents | 93f03c6714d8 |
| children | 18addf2a8596 |
line wrap: on
line diff
--- a/roundup/backends/rdbms_common.py Fri Mar 19 05:27:55 2004 +0000 +++ b/roundup/backends/rdbms_common.py Sun Mar 21 23:39:08 2004 +0000 @@ -1,4 +1,4 @@ -# $Id: rdbms_common.py,v 1.82 2004-03-19 04:47:59 richard Exp $ +# $Id: rdbms_common.py,v 1.83 2004-03-21 23:39:08 richard Exp $ ''' Relational database (SQL) backend common code. Basics: @@ -39,7 +39,7 @@ # support from blobfiles import FileStorage -from indexer_dbm import Indexer +from indexer_rdbms import Indexer from sessions_rdbms import Sessions, OneTimeKeys from roundup.date import Range @@ -59,7 +59,7 @@ self.config, self.journaltag = config, journaltag self.dir = config.DATABASE self.classes = {} - self.indexer = Indexer(self.dir) + self.indexer = Indexer(self) self.security = security.Security(self) # additional transaction support for external files and the like @@ -177,7 +177,7 @@ self.reindex() # commit - self.conn.commit() + self.sql_commit() # update this number when we need to make changes to the SQL structure # of the backen database @@ -591,7 +591,7 @@ if __debug__: print >>hyperdb.DEBUG, 'newid', (self, sql, classname) self.cursor.execute(sql, (classname, )) - newid = self.cursor.fetchone()[0] + newid = int(self.cursor.fetchone()[0]) # update the counter sql = 'update ids set num=%s where name=%s'%(self.arg, self.arg) @@ -1066,6 +1066,7 @@ def close(self): ''' Close off the connection. ''' + self.indexer.close() self.sql_close() #
