def __init__(self, dbname='test.db', autocommit=1, encoding='utf-8'): isolation_level = '' if autocommit: isolation_level = None LocalConnection.__init__(self, dbname, isolation_level=isolation_level) #self.row_factory = ResultSet #self.row_factory = attribute_factory #self.row_factory = Row self.row_factory = ResultSetRow
def __init__(self, address, row_factory=None, warning_threshold=100, autocommit=True): Connection.__init__(self, address) self.address = address if autocommit: self.isolation_level = None if row_factory: if not callable(row_factory): row_factory = ROW_FACTORIES[row_factory] self.row_factory = row_factory self.warning_threshold = warning_threshold
def __init__(self): # if does not exist, format / create tables Connection.__init__(self, self.FILE, check_same_thread=False) self.cur = self.cursor() # The TIME is the number on the clock when the game ended in success or failure self._execute(""" CREATE TABLE IF NOT EXISTS DATA ( ID INTEGER PRIMARY KEY AUTOINCREMENT , NAME VARCHAR, LASERS INT NOT NULL, CODE INT NOT NULL, COLOR VARCHAR NOT NULL, TIME INT NOT NULL, SUCCESS BOOL NOT NULL ) """) self.commit()
def __init__(self, **args): Connection.__init__(self, path.abspath('Database/main.db')) self.cur = self.cursor() self.date = datetime.now().date() self.time = str(datetime.now().time())
def __init__(self): Connection.__init__(self, "main.db") self.cur = self.cursor()