mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-04-14 18:41:04 +08:00
Init database module
This commit is contained in:
0
src/module/database/__init__.py
Normal file
0
src/module/database/__init__.py
Normal file
16
src/module/database/connector.py
Normal file
16
src/module/database/connector.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from sqlite3 import Cursor
|
||||
|
||||
|
||||
from module.conf import settings, DATA_PATH
|
||||
|
||||
|
||||
class DataConnector:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
pass
|
||||
|
||||
27
src/module/database/opreator.py
Normal file
27
src/module/database/opreator.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from .connector import DataConnector
|
||||
|
||||
|
||||
from module.models import BangumiData
|
||||
|
||||
|
||||
class DataOperator(DataConnector):
|
||||
def insert(self, data: BangumiData):
|
||||
pass
|
||||
|
||||
def insert_list(self, data: list[BangumiData]):
|
||||
pass
|
||||
|
||||
def update(self, data: BangumiData) -> bool:
|
||||
pass
|
||||
|
||||
def search(self, id: int) -> bool:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
def match_title(self, title: str) -> bool:
|
||||
return False
|
||||
|
||||
def gen_id(self) -> int:
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user