You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
integresql-client-python is tested against Python 3.8+. Older Python versions may work, or may not.
How to use
fromintegresql_client_pythonimportIntegreSQLintegresql=IntegreSQL('template_directory')
# integresql.debug = Truewithintegresqlastpl:
withtpl.initialize() asdbinfo:
# dbinfo is None if template is already initializedifdbinfo:
# connect and import fixturesprint("initialize db with fixtures with db data:", dbinfo)
db=tpl.get_database()
withdbasdbinfo:
# connect and do whatever you wantprint("Do your tests with db data:", dbinfo)
# or manually, you can use as many databases as you need or IntegreSQL will allowdbinfo1=db.open()
print("Do your tests", dbinfo1)
dbinfo2=db.open()
print("Do your tests", dbinfo2)
dbinfo3=db.open()
print("Do your tests", dbinfo3)
# connect and do whatever you want# do not forget about closing resources:db.close(dbinfo1)
db.close(dbinfo2)
db.close(dbinfo3)
If you like or dislike this software, please do not hesitate to tell me about
it via email (marcin@urzenia.net).
If you find a bug or have an idea to enhance this tool, please use GitHub's
issues.
ChangeLog
v0.9.2
fixed a bug where test database was returned to pool after every test and got reused.
Renamed method Database.close() to Database.mark_unmodified(). Using
Database in with block doesn't return selected database to pool anymore.