Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Connecting to in-memory SQLite database

We can also create in-memory database.

This is not persistent, but it can be useful to load some data into memory and then do fast SQL queries on that database.

import sqlite3

conn = sqlite3.connect(":memory:")
crs = conn.cursor()

# use the database here

conn.close()