Skip to content

Commit

Permalink
Expose store._sql for upgrade.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
jtobey committed Mar 31, 2014
1 parent 308d88c commit ce01286
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Abe/DataStore.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def __init__(store, args):
sql_args.prefix = "abe_"
sql_args.config = {}
store.sql_args = sql_args
store._sql = None
store.set_db(None)
store.init_sql()

store._blocks = {}
Expand Down Expand Up @@ -218,6 +218,12 @@ def __init__(store, args):

store.commit()

def set_db(store, db):
store._sql = db

def get_db(store):
return store._sql

def connect(store):
return store._sql.connect()

Expand Down Expand Up @@ -265,7 +271,7 @@ def init_sql(store):
sql_args.config[name[len('sql.'):]] = store.config[name]
if store._sql:
store._sql.close() # XXX Could just set_flavour.
store._sql = SqlAbstraction.SqlAbstraction(sql_args)
store.set_db(SqlAbstraction.SqlAbstraction(sql_args))
store.init_binfuncs()

def init_binfuncs(store):
Expand Down

0 comments on commit ce01286

Please sign in to comment.