Skip to content

Commit 44f76df

Browse files
euri10cofin
authored andcommitted
3
1 parent 348d89c commit 44f76df

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

docs/examples/usage/test_index_3.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,24 @@
77
spec = SQLSpec()
88
db = spec.add_config(SqliteConfig())
99
with spec.provide_session(db) as session:
10-
_ = session.execute("""
10+
_ = session.execute("""
1111
CREATE TABLE users (
1212
id INTEGER PRIMARY KEY,
1313
name TEXT NOT NULL,
1414
email TEXT,
1515
active BOOLEAN NOT NULL DEFAULT 1
1616
)
1717
""")
18-
_ = session.execute("""INSERT INTO users VALUES (1, 'alice', 'alice
18+
_ = session.execute("""INSERT INTO users VALUES (1, 'alice', 'alice
1919
@example.com', 1),
2020
(2, 'bob', 'bob@example.com', 0),
2121
(3, 'carol', 'carol@examplecom', 1)""")
2222

2323

24-
24+
p = Path(__file__).parent.parent / "queries/users.sql"
25+
assert p.exists()
2526
loader = SQLFileLoader()
26-
loader.load_sql(Path(__file__) / "queries/users.sql")
27+
loader.load_sql(p)
2728

2829
user_query = loader.get_sql("get_user_by_id", user_id=2)
2930
result = session.execute(user_query)

docs/usage/index.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Quick Reference
5252
**Basic Query Execution**
5353

5454
.. literalinclude:: /docs/examples/usage/test_index_1.py
55-
:langage: python
55+
:language: python
5656
:caption: ``basic query execution``
5757
:lines: 4-16
5858
:dedent: 2
@@ -61,17 +61,17 @@ Quick Reference
6161
**Using the Query Builder**
6262

6363
.. literalinclude:: /docs/examples/usage/test_index_2.py
64-
:langage: python
65-
:caption: ``using the qery builder``
64+
:language: python
65+
:caption: ``using the query builder``
6666
:lines: 19-21
6767
:dedent: 2
6868

6969

7070
**Loading from SQL Files**
7171

7272
.. literalinclude:: /docs/examples/usage/test_index_3.py
73-
:langage: python
74-
:caption: ``loading fron sql files``
73+
:language: python
74+
:caption: ``loading from sql files``
7575
:lines: 25-29
7676
:dedent: 2
7777

0 commit comments

Comments
 (0)