✨ 支持mysql,psql,sqlite随机函数

This commit is contained in:
HibiKier
2024-09-07 16:46:56 +08:00
parent 62fd93c1ff
commit 057001f0bd
3 changed files with 30 additions and 5 deletions
+8
View File
@@ -32,6 +32,14 @@ class BotSetting(BaseModel):
return random.choice(platform_superuser)
return ""
def get_sql_type(self) -> str:
"""获取数据库类型
返回:
str: 数据库类型, postgres, aiomysql, sqlite
"""
return self.db_url.split(":", 1)[0] if self.db_url else ""
Config = ConfigsManager(Path() / "data" / "configs" / "plugins2config.yaml")