Implement search
This commit is contained in:
@@ -1,6 +1,20 @@
|
||||
from peewee import Model, MySQLDatabase
|
||||
|
||||
database = MySQLDatabase(None)
|
||||
from lib.Config import DatabaseConfig
|
||||
|
||||
database: MySQLDatabase = MySQLDatabase(None)
|
||||
|
||||
|
||||
def init_database_from_config(config: DatabaseConfig):
|
||||
database.init(
|
||||
host=config['DB_HOST'],
|
||||
user=config['DB_USER'],
|
||||
password=config['DB_PASS'],
|
||||
database=config['DB_NAME'],
|
||||
port=int(config['DB_PORT']),
|
||||
connect_timeout=5,
|
||||
)
|
||||
database.connect()
|
||||
|
||||
|
||||
class BaseModel(Model):
|
||||
|
||||
Reference in New Issue
Block a user