Improved login funtion by creating temporary HTML pages and fixing bugs in login
This commit is contained in:
BIN
database/__pycache__/database.cpython-310.pyc
Normal file
BIN
database/__pycache__/database.cpython-310.pyc
Normal file
Binary file not shown.
BIN
database/app.db
BIN
database/app.db
Binary file not shown.
22
database/database.py
Normal file
22
database/database.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import sqlite3
|
||||
import os
|
||||
|
||||
class Database:
|
||||
def __init__(self) -> None:
|
||||
self._db = os.path.join(os.path.abspath(os.path.dirname(__file__)), "app.db")
|
||||
|
||||
def create_connection(self) -> sqlite3.Cursor:
|
||||
conn = sqlite3.connect(self._db)
|
||||
conn.row_factory = sqlite3.Row
|
||||
self._conn = conn
|
||||
cursor = conn.cursor()
|
||||
return cursor
|
||||
|
||||
def commit_data(self):
|
||||
try:
|
||||
self._conn.commit()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
def close_connection(self) -> None:
|
||||
self._conn.close()
|
||||
@@ -5,10 +5,13 @@ CREATE TABLE users
|
||||
password VARCHAR(256) NOT NULL,
|
||||
email VARCHAR(64) NOT NULL,
|
||||
num_followers INTEGER NOT NULL,
|
||||
isPartenered BOOLEAN NOT NULL DEFAULT 0
|
||||
bio TEXT,
|
||||
isPartenered BOOLEAN NOT NULL DEFAULT 0,
|
||||
bio TEXT
|
||||
);
|
||||
|
||||
SELECT * FROM users;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS streams;
|
||||
CREATE TABLE streams
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user