|
@@ -2,7 +2,7 @@ import sqlite3
|
|
|
import Stateful
|
|
|
|
|
|
deType = "sqlite3"
|
|
|
-dbPath = "dev.db"
|
|
|
+dbPath = "d<EV>.db"
|
|
|
|
|
|
|
|
|
def is_exist(tableName, columnName):
|
|
@@ -13,16 +13,52 @@ def Secondary_response():
|
|
|
|
|
|
|
|
|
def Operate_sqlite3(dbPath, commands):
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- v = "SELECT * FROM {tableName} WHERE name={name}".format(tableName=str(commands[1]).capitalize(), name="'"+commands[2]+"'")
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
|
|
|
+ v = "SELECT * FROM {tableName} WHERE name={name}".format(tableName=str(commands[1]).capitalize(), name="'"+commands[2]+"'")
|
|
|
+
|
|
|
con = sqlite3.connect(dbPath)
|
|
|
cur = con.cursor()
|
|
|
|
|
@@ -34,11 +70,14 @@ def Operate_sqlite3(dbPath, commands):
|
|
|
|
|
|
if res.fetchone() is None == True:
|
|
|
print("err <Code>: could not found, creat? y/n")
|
|
|
+
|
|
|
|
|
|
+
|
|
|
|
|
|
- matched = Stateful.MatchTomlKeys('dev_config.toml', commands, 'sqlite3')
|
|
|
+ matched = Stateful.MatchTomlKeys('d<EV>_config.toml', commands, 'sqlite3')
|
|
|
print(matched)
|
|
|
|
|
|
+
|
|
|
except:
|
|
|
print("err <Code>: Syntax error")
|
|
|
|
|
@@ -46,14 +85,6 @@ def Operate_sqlite3(dbPath, commands):
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
- sy = "CREATE TABLE Board(board_uid, board_name, status)"
|
|
|
- sy1 = "INSERT INTO Board VALUES('1', 'board1', 'live');"
|
|
|
- sy2 = "DROP TABLE test;"
|
|
|
- sy3 = "DROP TABLE Board"
|
|
|
- sy4 = "CREATE TABLE Board(uid, name, status)"
|
|
|
- sy5 = "INSERT INTO Board VALUES('1', 'KB1', 'live');"
|
|
|
-
|
|
|
- sy6 = ['add', 'board', 'KB1']
|
|
|
|
|
|
while(1):
|
|
|
sy_i = input("sql: ").split(" ")
|