Spaces:
Sleeping
Sleeping
DmitrMakeev
commited on
Commit
•
374bfe5
1
Parent(s):
3fd916b
Update my_sqlite.py
Browse files- my_sqlite.py +0 -33
my_sqlite.py
CHANGED
@@ -1,6 +1,3 @@
|
|
1 |
-
import sqlite3
|
2 |
-
|
3 |
-
|
4 |
from flask import request, jsonify
|
5 |
import globs
|
6 |
import os
|
@@ -8,36 +5,6 @@ import os
|
|
8 |
|
9 |
|
10 |
|
11 |
-
def create_db():
|
12 |
-
# Создание подключения к базе данных SQLite
|
13 |
-
conn = sqlite3.connect('mydatabase.db')
|
14 |
-
cur = conn.cursor()
|
15 |
-
|
16 |
-
# Создание таблицы с автоинкрементным столбцом
|
17 |
-
cur.execute('''
|
18 |
-
CREATE TABLE IF NOT EXISTS my_table (
|
19 |
-
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
20 |
-
column1 TEXT,
|
21 |
-
column2 TEXT,
|
22 |
-
column3 TEXT,
|
23 |
-
column4 TEXT,
|
24 |
-
column5 TEXT,
|
25 |
-
column6 TEXT,
|
26 |
-
column7 TEXT,
|
27 |
-
column8 TEXT,
|
28 |
-
column9 TEXT,
|
29 |
-
column10 TEXT
|
30 |
-
)
|
31 |
-
''')
|
32 |
-
|
33 |
-
# Применение изменений и закрытие соединения
|
34 |
-
conn.commit()
|
35 |
-
cur.close()
|
36 |
-
conn.close()
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
|
42 |
|
43 |
|
|
|
|
|
|
|
|
|
1 |
from flask import request, jsonify
|
2 |
import globs
|
3 |
import os
|
|
|
5 |
|
6 |
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
|
10 |
|