Created
January 6, 2025 16:50
-
-
Save Voronenko/db2e5f9f1a42950bfc29757f48cb1f1f to your computer and use it in GitHub Desktop.
Example on accessing crypto ability cash db
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import apsw | |
# https://pypi.org/project/apsw-sqlite3mc/ | |
# https://github.com/utelle/apsw-sqlite3mc | |
print(apsw.mc_version) | |
con = apsw.Connection("base.cash") | |
con.pragma("cipher", "aes256cbc") | |
print(con.pragma("key", "DB_PASSWORD")) | |
print(f"Database Connection: {con.total_changes}") | |
cursor = con.cursor() | |
print(f'{cursor=}') | |
# List if tables | |
cursor.execute("SELECT name FROM sqlite_master WHERE type='table';") | |
tables = cursor.fetchall() | |
print(f'{tables=}') | |
print("List of tables in the database:") | |
for table in tables: | |
print(table[0]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment