Contact: fumanchu@aminus.org

Log in as guest/dejavu to create tickets

I think I've seen this ORM somewhere before...

root/branches/crazycache/dejavu/storage/storepypgsql.py

Revision 511 (checked in by fumanchu, 4 years ago)

Reverted PG schema craziness (silly me was using master conns for CREATE SCHEMA).

  • Property svn:eol-style set to native
Line 
1 from geniusql.providers import pypgsql
2 from dejavu.storage import db, multischema
3
4
5 class StorageManagerPgSQL(db.StorageManagerDB):
6     """StoreManager to save and retrieve Units via pyPgSQL 1.35."""
7    
8     databaseclass = pypgsql.PyPgDatabase
9    
10     def __init__(self, allOptions={}):
11         for atom in allOptions['connections.Connect'].split(" "):
12             k, v = atom.split("=", 1)
13             if k == "dbname":
14                 allOptions['name'] = v
15         db.StorageManagerDB.__init__(self, allOptions)
16
17
18 class MultiSchemaStorageManagerPg(multischema.MultiSchemaStorageManagerDB):
19     """StoreManager to save and retrieve multiple schemas via pyPgSQL."""
20    
21     databaseclass = pypgsql.PyPgDatabase
22    
23     def __init__(self, allOptions={}):
24         for atom in allOptions['connections.Connect'].split(" "):
25             k, v = atom.split("=", 1)
26             if k == "dbname":
27                 allOptions['name'] = v
28         multischema.MultiSchemaStorageManagerDB.__init__(self, allOptions)
Note: See TracBrowser for help on using the browser.