-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed #90 实现kv数据库接口 #93
Conversation
k-v data json document sql
api/db.py
Outdated
} | ||
|
||
|
||
def valide_tablename(table_name: str) -> tuple[bool, str, int]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validate
api/db.py
Outdated
|
||
from mod.db import SqliteDict, saved_path | ||
|
||
SQLITE_RESERVED_WORDS = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好像并没有用于限制CREATE TABLE
,检查这个好像不是特别有用(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好像确实表名没那么多限制,引号加一个就行
return message, 200 | ||
else: | ||
return {"code": code, "message": message}, code | ||
elif request.method == "DELETE": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改动和删除数据不也敏感吗(
端点:
/api/v1/db/<table_name>
操作: