python_bot/sql.py
Pavel_Duron 91f5cdf483
All checks were successful
continuous-integration/drone/push Build is passing
тст
2022-11-07 20:08:19 +10:00

28 lines
503 B
Python

import sqlite3 as sq
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)''')
db.commit()
async def add_user():
await cur.execute('''INSERT INTO users (users_id, user_name) VALUES (?, ?)''',[id1, fullname1])
await db.commit()
async def close():
await db.commit()
await db.close()