sql_db
Raw SQL query execution with optional result parsing.
DbSql
Used to run raw SQL queries.
Source code in src/embar/sql_db.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
__await__()
Run the query asynchronously without returning results.
Source code in src/embar/sql_db.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
__init__(template, db)
Create a new DbSql instance.
Source code in src/embar/sql_db.py
21 22 23 24 25 26 | |
model(model)
Specify a model for parsing results.
Source code in src/embar/sql_db.py
28 29 30 31 32 | |
run()
Run the query synchronously without returning results.
Returns self so that await db.sql(...).run() works for async.
For sync callers, the return value can be ignored.
Source code in src/embar/sql_db.py
55 56 57 58 59 60 61 62 63 64 65 66 | |
DbSqlReturning
Used to run raw SQL queries and return a value.
Source code in src/embar/sql_db.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | |
__await__()
Run the query asynchronously and return parsed results.
Source code in src/embar/sql_db.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
__init__(sql, model, db)
Create a new DbSqlReturning instance.
Source code in src/embar/sql_db.py
78 79 80 81 82 83 84 | |
run()
Run the query synchronously and return parsed results.
For async, use await query instead.
Source code in src/embar/sql_db.py
110 111 112 113 114 115 116 117 118 119 120 121 122 | |