Skip to content

Commit 8dc8e62

Browse files
committed
Some comments.
1 parent 209bf5e commit 8dc8e62

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

tests/test_qblike_3.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,31 @@
3232
from . import format_helper
3333

3434

35+
"""
36+
An example of a SQL-Alchemy like ORM.
37+
38+
The User and Post classes model a SQLite schema:
39+
```
40+
CREATE TABLE users (
41+
id INTEGER PRIMARY KEY AUTOINCREMENT,
42+
name TEXT NOT NULL,
43+
email TEXT UNIQUE NOT NULL,
44+
age INTEGER,
45+
active BOOLEAN DEFAULT TRUE
46+
);
47+
48+
CREATE TABLE posts (
49+
id INTEGER PRIMARY KEY AUTOINCREMENT,
50+
content TEXT NOT NULL,
51+
author_id INTEGER NOT NULL,
52+
FOREIGN KEY (author_id) REFERENCES users (id)
53+
);
54+
```
55+
56+
Protocols are generated using AddInit[T], Create[T], and Update[T].
57+
"""
58+
59+
3560
type ReplaceNever[T, D] = T if not IsSub[T, Never] else D
3661
type GetFieldItem[T: InitField, K, Default] = ReplaceNever[
3762
GetAttr[GetArg[T, InitField, 0], K], Default

0 commit comments

Comments
 (0)