Re: [SQLObject] DataBaseIndex with USING
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2011-04-13 10:04:59
|
Hello! Sorry for the later answer. On Thu, Apr 07, 2011 at 01:53:14PM +0200, Gregor Horvath wrote: > it doesn't seem to be possible to define an index like this: > > CREATE INDEX location_trgm_idx ON location USING gist (address > gist_trgm_ops); > > http://www.postgresql.org/docs/current/static/pgtrgm.html > > After a quick look at index.py it should be possible to patch it to > accept a new parameter for example "using" and insert it into the sql > creation in: > > def sqliteCreateIndexSQL(self, soClass): > [...] > ret = 'CREATE %s %s_%s ON %s (%s)' % \ > (uniqueOrIndex, > self.soClass.sqlmeta.table, > self.name, > self.soClass.sqlmeta.table, > ', '.join(spec)) > return ret > > should get something like: > > def sqliteCreateIndexSQL(self, soClass): > [...] > ret = 'CREATE %s %s_%s ON %s %s (%s)' % \ > (uniqueOrIndex, > self.soClass.sqlmeta.table, > self.name, > self.soClass.sqlmeta.table, > self.using, > ', '.join(spec) > ) > return ret > > I don't know if this is a postgresql specific thing or not and should > therefore only be inserted for postgresql. We can afford to put the burden of not defining self.using upon the user. At least for beginning. > Is such a patch welcomed? Certainly. Thank you in advance! Oleg. -- Oleg Broytman http://phdru.name/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |