DCAv2/utils/data/db_read.py

22 lines
480 B
Python

import sqlite3
import sys
# Connect to the SQLite database
conn = sqlite3.connect(f"{sys.argv[1]}.db")
cursor = conn.cursor()
# Execute a SELECT query to retrieve data from the database
cursor.execute('SELECT * FROM volatilities_table')
# Fetch all rows from the result set
rows = cursor.fetchall()
# Print the data
for row in rows:
print(row)
#data = json.loads(rows[-3][-1])
#print(data[-1])
#print(f"Number of entries: {len(rows)}")
# Close the connection
conn.close()