Skip to content

Commit

Permalink
updated docstrings to new sessionmaker methods
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 committed May 31, 2017
1 parent c2f51fa commit 99393da
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions gsshapy/lib/db_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,11 @@ def init_sqlite_memory(initTime=False):
from gsshapy.lib.db_tools import init_sqlite_memory, create_session
sqlite_db_path = '/home/username/my_sqlite.db'
sqlalchemy_url, engine = init_postgresql_db(path=sqlite_db_path)
db_work_session = create_session(sqlalchemy_url, engine)
sqlalchemy_url, engine = init_sqlite_memory()
db_work_sessionmaker = get_sessionmaker(sqlalchemy_url, engine)
db_work_session = db_work_sessionmaker()
##DO WORK
db_work_session.close()
Expand Down Expand Up @@ -96,9 +95,11 @@ def init_sqlite_db(path, initTime=False):
init_postgresql_db(path=sqlite_db_path)
sqlalchemy_url = init_postgresql_db(path=sqlite_db_path)
sqlalchemy_url = init_sqlite_db(path=sqlite_db_path)
db_work_session = create_session(sqlalchemy_url)
db_work_sessionmaker = get_sessionmaker(sqlalchemy_url)
db_work_session = db_work_sessionmaker()
##DO WORK
Expand Down Expand Up @@ -140,7 +141,9 @@ def init_postgresql_db(username, host, database, port='', password='', initTime=
port='5432',
password='pass')
db_work_session = create_session(sqlalchemy_url)
db_work_sessionmaker = get_sessionmaker(sqlalchemy_url)
db_work_session = db_work_sessionmaker()
##DO WORK
Expand Down Expand Up @@ -195,8 +198,9 @@ def init_mysql_db(username, host, database, port='', password='', initTime=False
port='5432',
password='pass')
db_work_session = create_session(sqlalchemy_url)
db_work_sessionmaker = get_sessionmaker(sqlalchemy_url)
db_work_session = db_work_sessionmaker()
##DO WORK
db_work_session.close()
Expand Down

0 comments on commit 99393da

Please sign in to comment.