From c7d88037951424a2544184091a05243d0aa84532 Mon Sep 17 00:00:00 2001 From: OkunElya Date: Mon, 15 Dec 2025 22:44:12 +1000 Subject: [PATCH] table creation added --- .gitignore | 3 ++- src/app.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 9a3cb77..7b15f3c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ build .vscode -**__pycache__ \ No newline at end of file +**__pycache__ +data \ No newline at end of file diff --git a/src/app.py b/src/app.py index 0025f2d..194b367 100644 --- a/src/app.py +++ b/src/app.py @@ -1,8 +1,11 @@ -import os import sqlite3 from fastapi import FastAPI +DB_PATH = "./data/database.db" +conn = sqlite3.connect(DB_PATH) +cursor = conn.cursor() +cursor.execute("CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, login TEXT NOT NULL UNIQUE, password TEXT NOT NULL)") app = FastAPI( docs_url=None, # Disable Swagger UI