Files
kis_bot/scratch/update_env.py

20 lines
594 B
Python

import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..')
from database import TradeDB
db = TradeDB()
try:
db.conn.execute("""
INSERT INTO env_config (env_key, env_value)
VALUES ('WS_ORDERBOOK_SAVE_KIS', 'true')
ON DUPLICATE KEY UPDATE env_value = 'true'
""")
print("Updated WS_ORDERBOOK_SAVE_KIS to 'true' in env_config.")
db.conn.commit()
val = db.conn.execute("SELECT env_value FROM env_config WHERE env_key = 'WS_ORDERBOOK_SAVE_KIS'").fetchone()
print("Verification:", dict(val))
finally:
db.close()