refactor: enhance Optuna backtesting framework, optimize orderbook filtering, and update database management utilities.
This commit is contained in:
26
scratch/db_check.py
Normal file
26
scratch/db_check.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import sys
|
||||
import os
|
||||
sys.path.append('/home/hoon/kis_bot')
|
||||
|
||||
from database import TradeDB
|
||||
|
||||
def check_db():
|
||||
db = TradeDB()
|
||||
try:
|
||||
# Check tables
|
||||
tables = [dict(r) for r in db.conn.execute("SHOW TABLES").fetchall()]
|
||||
print("Tables:", tables)
|
||||
|
||||
# Let's check environment variables and settings related to slots and buying
|
||||
cols_env = [dict(r)["Field"] for r in db.conn.execute("SHOW COLUMNS FROM env_settings").fetchall()]
|
||||
print("env_settings cols:", cols_env)
|
||||
|
||||
env_vars = db.conn.execute("SELECT * FROM env_settings").fetchall()
|
||||
for env in env_vars:
|
||||
print(dict(env))
|
||||
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
check_db()
|
||||
Reference in New Issue
Block a user