comparison roundup/backends/back_postgresql.py @ 2089:93f03c6714d8

A few big changes in this commit: 1. The current indexer has been moved to backends/indexer_dbm in anticipation of my writing an indexer_rdbms, 2. Changed indexer invocation during create / set to follow the pattern set by the metakit backend, which was much cleaner, and 3. The "content" property of FileClass is now mutable in all but the metakit backend. Metakit needs to be changed to support the editing of "content". Hey, and I learnt today that the metakit backend implements its own indexer. How about that... :)
author Richard Jones <richard@users.sourceforge.net>
date Fri, 19 Mar 2004 04:47:59 +0000
parents c091cacdc505
children 3f6024ab2c7a
comparison
equal deleted inserted replaced
2088:90769be53b4b 2089:93f03c6714d8
144 144
145 def create_class_table(self, spec): 145 def create_class_table(self, spec):
146 cols, mls = self.determine_columns(spec.properties.items()) 146 cols, mls = self.determine_columns(spec.properties.items())
147 cols.append('id') 147 cols.append('id')
148 cols.append('__retired__') 148 cols.append('__retired__')
149 scols = ',' . join(['"%s" VARCHAR(255)' % x for x in cols]) 149 scols = ',' . join(['"%s" VARCHAR(255)'%x for x in cols])
150 sql = 'CREATE TABLE "_%s" (%s)' % (spec.classname, scols) 150 sql = 'CREATE TABLE "_%s" (%s)' % (spec.classname, scols)
151
152 if __debug__: 151 if __debug__:
153 print >>hyperdb.DEBUG, 'create_class', (self, sql) 152 print >>hyperdb.DEBUG, 'create_class_table', (self, sql)
154
155 self.cursor.execute(sql) 153 self.cursor.execute(sql)
156 self.create_class_table_indexes(spec) 154 self.create_class_table_indexes(spec)
157 return cols, mls 155 return cols, mls
158 156
159 def create_journal_table(self, spec): 157 def create_journal_table(self, spec):
160 cols = ',' . join(['"%s" VARCHAR(255)' % x 158 cols = ',' . join(['"%s" VARCHAR(255)'%x
161 for x in 'nodeid date tag action params' . split()]) 159 for x in 'nodeid date tag action params' . split()])
162 sql = 'CREATE TABLE "%s__journal" (%s)'%(spec.classname, cols) 160 sql = 'CREATE TABLE "%s__journal" (%s)'%(spec.classname, cols)
163
164 if __debug__: 161 if __debug__:
165 print >>hyperdb.DEBUG, 'create_class', (self, sql) 162 print >>hyperdb.DEBUG, 'create_journal_table', (self, sql)
166
167 self.cursor.execute(sql) 163 self.cursor.execute(sql)
168 self.create_journal_table_indexes(spec) 164 self.create_journal_table_indexes(spec)
169 165
170 def create_multilink_table(self, spec, ml): 166 def create_multilink_table(self, spec, ml):
171 sql = '''CREATE TABLE "%s_%s" (linkid VARCHAR(255), 167 sql = '''CREATE TABLE "%s_%s" (linkid VARCHAR(255),
172 nodeid VARCHAR(255))''' % (spec.classname, ml) 168 nodeid VARCHAR(255))'''%(spec.classname, ml)
173 169
174 if __debug__: 170 if __debug__:
175 print >>hyperdb.DEBUG, 'create_class', (self, sql) 171 print >>hyperdb.DEBUG, 'create_class', (self, sql)
176 172
177 self.cursor.execute(sql) 173 self.cursor.execute(sql)

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