42 lines
1.0 KiB
Python
42 lines
1.0 KiB
Python
|
|
#!/usr/bin/env python3
|
||
|
|
# -*- coding: utf-8 -*-
|
||
|
|
"""
|
||
|
|
测试腾讯云数据库初始化脚本
|
||
|
|
"""
|
||
|
|
import sys
|
||
|
|
import os
|
||
|
|
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||
|
|
|
||
|
|
from src.flask_prompt_master.promptsTemplates import init_tencent_db, init_local_db
|
||
|
|
|
||
|
|
def main():
|
||
|
|
"""主函数"""
|
||
|
|
print("=" * 60)
|
||
|
|
print("🗄️ 数据库初始化工具")
|
||
|
|
print("=" * 60)
|
||
|
|
|
||
|
|
while True:
|
||
|
|
print("\n请选择要初始化的数据库:")
|
||
|
|
print("1. 本地数据库 (localhost)")
|
||
|
|
print("2. 腾讯云数据库")
|
||
|
|
print("3. 退出")
|
||
|
|
|
||
|
|
choice = input("\n请输入选择 (1-3): ").strip()
|
||
|
|
|
||
|
|
if choice == '1':
|
||
|
|
print("\n" + "="*40)
|
||
|
|
init_local_db()
|
||
|
|
print("="*40)
|
||
|
|
elif choice == '2':
|
||
|
|
print("\n" + "="*40)
|
||
|
|
init_tencent_db()
|
||
|
|
print("="*40)
|
||
|
|
elif choice == '3':
|
||
|
|
print("👋 退出程序")
|
||
|
|
break
|
||
|
|
else:
|
||
|
|
print("❌ 无效选择,请重新输入")
|
||
|
|
|
||
|
|
if __name__ == '__main__':
|
||
|
|
main()
|