FastAuth/queries.py

25 lines
494 B
Python
Raw Normal View History

2024-06-21 04:42:19 +00:00
import sqlite3
def connect_db():
conn = sqlite3.connect('database/database.sqlite')
conn.execute("PRAGMA foreign_keys = 1")
return conn
CREATE_USER_QUERY = """
INSERT INTO
users (
name, email, username, password
)
VALUES (
:name, :email, :username, :password
)
returning id
"""
CREATE_KEY_QUERY = """
INSERT INTO
keys (user_id, encryption_key, encryption_key_salt)
VALUES (:user_id, :encryption_key, :encryption_key_salt)
"""