14 lines
368 B
Python
14 lines
368 B
Python
import sqlite_utils
|
|
|
|
#Create (or open) the database
|
|
db = sqlite_utils.Database("dbot.db")
|
|
|
|
#Create the 'users' table with some example columns
|
|
#primary_key=True means 'id' will be the unique identifier
|
|
db["users"].create({
|
|
"id": int,
|
|
"username": str,
|
|
"balance": int
|
|
}, pk="id", if_not_exists=True)
|
|
|
|
print("Database and 'users' table created successfully!") |