Skip to main content
The sqlite3 module provides a SQL database interface compatible with SQLite.

Module Import

Basic Usage

Connect to Database

Create Table

Insert Data

Query Data

Update and Delete

Row Factories

Practical Examples

Simple CRUD Operations

Transaction Management

Always use parameterized queries (? placeholders) to prevent SQL injection.
Remember to commit changes with conn.commit() or they will be lost.

pickle

Python object serialization

json

JSON encoding/decoding