ReplDBSQL - repl db now with sqlite3
now use your repl db as a full sqlite3 database
run advanced queries, and more!
Usage
- create a new file in your python repl (called
db.py
for example) and copy this code in - in your
main.py
file, addfrom db import ReplDBSQL
- use it like so
db = ReplDBSQL()
con = db.connect() # returns an sqlite3 db instance
cur = con.cursor() # as normal
cur.execute('CREATE TABLE users (ID INT)')
con.close()
db.commit() # save changes
# alternatively
db.run('INSERT INTO users (ID) VALUES (1)') # does the same as above
users = db.run('SELECT * FROM users WHERE ID = ?', (1,))
InvisibleOne (2263)
Oooohh, SQL
HahaYes (1900)
wow cool
SQL is a bit overkill, but its still cool