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
Add new parameter into init of Database classes, something like auto_conn or just connect or init_conn, which means "connect immediately" with object initialization. After adding "with-as" statement support it might be reasonable to creating object without creation connection. This parameter have to be True by default.
fromsqlleximportSQLite3x# might look like thisdb=SQLite3x(path='/path/database.db', init_conn=False)
# or thisdb=SQLite3x(path='/path/database.db', auto_conn=False)
# or maybe evendb=SQLite3x(path='/path/database.db', without_conn=True)
In code:
classSQLite3x(ABDatabase):
def__init__(self,
path: PathType="sql3x.db",
init_conn: bool=True,
template: DBTemplateType=None):
... # another routineself.__connection=None# init connectionifinit_conn: # <== HEREself.connect() # creating connection with db
... # yet another routine
Welcome you to join this discussion! How should we name this parameter?
The text was updated successfully, but these errors were encountered:
Add new parameter into init of Database classes, something like
auto_conn
or justconnect
orinit_conn
, which means "connect immediately" with object initialization. After adding "with-as" statement support it might be reasonable to creating object without creation connection. This parameter have to beTrue
by default.In code:
Welcome you to join this discussion! How should we name this parameter?
The text was updated successfully, but these errors were encountered: