Category: sqlite3

Problem

Basic create-read-update-delete with sqlite3.

Solution

  conn = sqlite3.connect("app.db")
conn.execute("INSERT INTO users (name) VALUES (?)", (name,))
  

Notes

  • Adapt variable names and paths to your project
  • Add error handling for production use
  • See related chapters in the Learning Path