23 lines
415 B
Python
23 lines
415 B
Python
import sqlite3
|
|
|
|
DIR = "/Users/mac/myfirstprogramm/storage/message.db"
|
|
if __name__ == "__main__":
|
|
db = sqlite3.connect(DIR)
|
|
|
|
cursor = db.cursor()
|
|
|
|
cursor.execute("""CREATE TABLE message (
|
|
chat_id integer,
|
|
message_id integer
|
|
)""")
|
|
db.commit()
|
|
|
|
cursor.execute("SELECT * FROM message")
|
|
print(cursor.fetchone())
|
|
|
|
db.close()
|
|
|
|
|
|
def get_db():
|
|
return sqlite3.connect(DIR)
|