On this page
  1. sqlite3.Row
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

sqlite3.Row

Prev: sqlite3.register_converter | Up: sqlite3 | Next: sqlite3.Time
Rel: sqlite3.adapt, sqlite3.Binary, sqlite3.Blob, sqlite3.complete_statement
Ref: docs.python.org — sqlite3.Row
Tags: #public #python3 #stdlib #sqlite3


Import

import sqlite3
from sqlite3 import Row

Signature & Overview

sqlite3.Row(...)

sqlite3.Row class.

Methods & Attributes

Usage

import sqlite3

con = sqlite3.connect(":memory:")
con.row_factory = sqlite3.Row
row = con.execute("SELECT 1 AS id, 'Ada' AS name").fetchone()
assert row["name"] == "Ada" and row[0] == 1 and dict(row) == {"id": 1, "name": "Ada"}
con.close()

Gotchas

REPL Inspect

from sqlite3 import Row
help(Row)

Linked from

Related notes