teff.tool.builtin.sql¶
teff.tool.builtin.sql
¶
SQL tools — read-only queries and schema inspection for SQLite/PostgreSQL.
Classes:
| Name | Description |
|---|---|
SQLDescribeTool |
Describe a table's columns and types. |
SQLListTablesTool |
List the tables in a database. |
SQLQueryTool |
Run a read-only SQL query against a database. |
SQLDescribeTool
¶
Bases: _SQLBase
Describe a table's columns and types.
Source code in teff/tool/builtin/sql.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
SQLListTablesTool
¶
Bases: _SQLBase
List the tables in a database.
Source code in teff/tool/builtin/sql.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
SQLQueryTool
¶
Bases: _SQLBase
Run a read-only SQL query against a database.
Only SELECT/WITH (read) statements are allowed; anything that
would mutate data (INSERT, UPDATE, DELETE, DDL, …) is
rejected. Placeholders match the backend: ? for SQLite, %s
for PostgreSQL.
Source code in teff/tool/builtin/sql.py
64 65 66 67 68 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 | |