def init(self, database):
self.connection = sqlite3.connect(database)
self.cursor = self.connection.cursor()
def add_new_user(self, userid, username):
with self.connection:
self.cursor.execute('INSERT INTO USER VALUES (?, ?)',(userid, username))
self.connection.commit()
print("Данные успешно записаны!")
def select_all_id(self):
""" Получаем все строки """
with self.connection:
return self.cursor.execute('SELECT id FROM USERS').fetchall()
def close(self):
self.connection.close()
уууу
Обсуждают сегодня