python_bot/sql.py

27 lines
479 B
Python
Raw Normal View History

import sqlite3 as sq
2022-11-07 19:58:59 +10:00
2022-11-07 00:52:46 +10:00
async def db_start(): #подключение к бд
global db, cur
db = sq.connect('dickpick.db')
cur = db.cursor()
cur.execute(''''CREATE TABLE IF NOT EXISTS users(id INTEGER PRIMARY KEY, users_id INTEGER, user_name TEXT, dick_size INTEGER)''')
db.commit()
2022-11-07 19:58:59 +10:00
async def add_user():
cur.execute('''INSERT INTO users (users_id, user_name) VALUES (?)''',[id1, fullname1])
db.commit()
2022-11-07 19:58:59 +10:00
async def close():
db.close()
2022-11-07 00:52:46 +10:00