Here I have simple python code to query sqlite3 database.
import sqlite3 as lite conn = lite.connect('db/posts.db') cur = conn.cursor() def get_posts(): cur.execute("SELECT * FROM Posts") print(cur.fetchall()) get_posts()
I have already created a Posts table. When I run this, I get no errors and it just prints [] . I know that the Posts table is not empty, I created it in REPL. Why is this not working?
Any help is appreciated!
source share