I get the above error for executing the below INSERT-statement. The database file ce.db is in the same directory as my code and I have successfully created the tables therein.
My sqlite version is 2.8.17 and I am confident that my db file exists as I can see it in my directory and have succeeded in creating tables therein.
import sqlite3
@app.route("/sign_up", methods=["GET", "POST"])
def sign_up():
# [..other code..]
conn = sqlite3.connect("ce.db")
c = conn.cursor()
result = c.execute("INSERT INTO users (name, hash) VALUES (:name, :hash)", {"name":request.form.get("username"), "hash":hashp})
conn.commit()
Debugger shows "sqlite3.DatabaseError: file is not a database" error for the line starting with "result=...".