diff options
| author | ced <> | 2007-11-21 15:24:36 +0000 |
|---|---|---|
| committer | ced <> | 2007-11-21 15:24:36 +0000 |
| commit | 04f86677c9c46c0097fea242cb2f9e345aa82170 (patch) | |
| tree | 96950ed749897c7e893a1d428324892522931e1f /bin/sql_db.py | |
| parent | 5ad164063d9c537a0c8a433e724e63c98d11df95 (diff) | |
Remove createdb and dropdb, use sql instead
Don't try to dump or restore on db connection that need password
bzr revid: ced-0f882f05e2c9ce25fd8e498c8fe8179614251824
Diffstat (limited to 'bin/sql_db.py')
| -rw-r--r-- | bin/sql_db.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/sql_db.py b/bin/sql_db.py index 91457922b31..aa8a5162eb7 100644 --- a/bin/sql_db.py +++ b/bin/sql_db.py @@ -130,14 +130,15 @@ def decimalize(symb): return decimal.Decimal('%f' % symb) return decimal.Decimal(symb) -def db_connect(db_name): +def db_connect(db_name, serialize=0): host = tools.config['db_host'] and "host=%s" % tools.config['db_host'] or '' port = tools.config['db_port'] and "port=%s" % tools.config['db_port'] or '' name = "dbname=%s" % db_name user = tools.config['db_user'] and "user=%s" % tools.config['db_user'] or '' password = tools.config['db_password'] and "password=%s" % tools.config['db_password'] or '' maxconn = int(tools.config['db_maxconn']) or 64 - tdb = psycopg.connect('%s %s %s %s %s' % (host, port, name, user, password), serialize=0, maxconn=maxconn) + tdb = psycopg.connect('%s %s %s %s %s' % (host, port, name, user, password), + serialize=serialize, maxconn=maxconn) fdb = fakedb(tdb, db_name) return fdb |
