Files
CDRM-Bot/helper_scripts/DB_Cache/cache_key.py
2023-11-17 00:52:41 -05:00

16 lines
424 B
Python

# Import dependencies
import sqlite3
import os
# Get the current working directory
main_directory = os.getcwd()
# Define cache function
def cache_keys(pssh: str, keys: str):
dbconnection = sqlite3.connect(f"{main_directory}\\keys\\database.db")
dbcursor = dbconnection.cursor()
dbcursor.execute("INSERT or REPLACE INTO database VALUES (?, ?)", (pssh, keys))
dbconnection.commit()
dbconnection.close()