| 39 | |
| 40 | @dataclass(frozen=True) |
| 41 | class QueryResult(Generic[SchemaT]): |
| 42 | rows: list[SchemaT] |
| 43 | rows_affected: int |
| 44 | """ |
| 45 | Row count semantics depend on the backend and the query type: |
| 46 | - SQLite: for SELECT, computed as the number of rows fetched; for UPDATE/DELETE, |
| 47 | computed as the delta of total changes. |
| 48 | - asyncpg: for SELECT, computed as the number of rows fetched; for UPDATE/DELETE, |
| 49 | parsed from the driver's command status. |
| 50 | - MySQL/ODBC/psycopg: typically uses cursor.rowcount for all queries. Note that for |
| 51 | some drivers or statement types (e.g., SELECT), rowcount can be driver-defined. |
| 52 | """ |
| 53 | |
| 54 | |
| 55 | @overload |
no outgoing calls
no test coverage detected
searching dependent graphs…