Spaces:
Sleeping
Sleeping
Download database/db.py from stkrk/dino_sam_objects: direct link, hf CLI and curl.
- Browser
- Download file 321 Bytes
-
https://huggingface.co/spaces/stkrk/dino_sam_objects/resolve/main/database/db.py
- Command line
-
hf download hf://spaces/stkrk/dino_sam_objects/database/db.py
-
curl -L -o db.py https://huggingface.co/spaces/stkrk/dino_sam_objects/resolve/main/database/db.py
321 Bytes
| import sqlite3 | |
| DB_PATH = "app.db" | |
| def get_connection(): | |
| return sqlite3.connect(DB_PATH) | |
| def init_db(): | |
| with open("database/schema.sql", "r") as f: | |
| schema = f.read() | |
| conn = get_connection() | |
| conn.executescript(schema) # Виконуємо SQL з файлу | |
| conn.commit() | |
| conn.close() | |