Skip to content

Commit

Permalink
add database
Browse files Browse the repository at this point in the history
  • Loading branch information
detectiveren committed Apr 23, 2024
1 parent 08ec222 commit a37d5cc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions luna.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import settings
from cryptography.fernet import Fernet
from time import sleep
import sqlite3

# Resources used to develop the app https://flet.dev/docs/tutorials/python-realtime-chat/#getting-started-with-flet
# For info on how to deal with keyboard events https://flet.dev/docs/guides/python/keyboard-shortcuts/
Expand Down Expand Up @@ -200,6 +201,19 @@ def __init__(self, videoMessage: LunaMessage):
]


def loadDatabase():
database_connection = sqlite3.connect('lunaData.db') # Establish connection to the database

database_cursor = database_connection.cursor() # Create the cursor

database_cursor.execute('SELECT * FROM accounts') # Get all data from accounts table

rows = database_cursor.fetchall() # Catch all the rows from the output

for row in rows:
print(row)


print("loaded classes LunaMessage, LunaChatMessage, LunaImageMessage and LunaVideoMessage, message container has been "
"created")

Expand Down
Binary file added lunaData.db
Binary file not shown.

0 comments on commit a37d5cc

Please sign in to comment.