-
Hello! Thank you for this wonderful library. I enjoy it so much that I wish to port it to Gleam. Is there documentation on the techniques used to type check the queries for each database supported? Or would you be able to give me a hint as to where to look in the codebase? To save me some time stumbling through the code :) Thank you, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
A basic overview is given in the FAQ: https://github.com/launchbadge/sqlx/blob/main/FAQ.md#how-do-the-query-macros-work-under-the-hood For where this happens in the source code, look at the source for https://github.com/launchbadge/sqlx/blob/main/sqlx-core/src/mssql/connection/executor.rs#L175 and then follow the path of execution from there. |
Beta Was this translation helpful? Give feedback.
A basic overview is given in the FAQ: https://github.com/launchbadge/sqlx/blob/main/FAQ.md#how-do-the-query-macros-work-under-the-hood
For where this happens in the source code, look at the source for
Executor::describe()
for the database's connection type:https://github.com/launchbadge/sqlx/blob/main/sqlx-core/src/mssql/connection/executor.rs#L175
https://github.com/launchbadge/sqlx/blob/main/sqlx-core/src/mysql/connection/executor.rs#L283
https://github.com/launchbadge/sqlx/blob/main/sqlx-core/src/postgres/connection/executor.rs#L415
https://github.com/launchbadge/sqlx/blob/main/sqlx-core/src/sqlite/connection/executor.rs#L89
and then follow the path of execution from there.