Skip to content

delegate statement preparation to sqlx #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 19, 2023
Merged

Conversation

lovasoa
Copy link
Collaborator

@lovasoa lovasoa commented Nov 18, 2023

The logic of preparing statements and caching them for later reuse is now entirely delegated to the sql driver library (sqlx).
This simplifies the code and logic inside sqlpage itself.

More importantly, statements are now prepared in a streaming fashion when a file is first loaded, instead of all at once, which allows referencing a temporary table created at the start of a file in a later statement in the same file.

fixes #100

The logic of preparing statements and caching them for later reuse is now entirely delegated to the sql driver library (sqlx).
This simplifies the code and logic inside sqlpage itself.

 More importantly, statements are now prepared in a streaming fashion when a file is first loaded, instead of all at once, which allows referencing a temporary table created at the start of a file in a later statement in the same file.

 fixes #100
@lovasoa
Copy link
Collaborator Author

lovasoa commented Nov 18, 2023

@ipftalabua @nanawel : this pr should solve your respective problems, by allowing creating a temporary table and then referencing it from inside the same .sql file.

mssql does not have "create temp table"
@lovasoa lovasoa merged commit edd94df into main Nov 19, 2023
@lovasoa lovasoa deleted the no-explicit-preparation branch November 19, 2023 00:32
lovasoa added a commit that referenced this pull request Nov 21, 2023
* delegate statement preparation to sqlx

The logic of preparing statements and caching them for later reuse is now entirely delegated to the sql driver library (sqlx).
This simplifies the code and logic inside sqlpage itself.

 More importantly, statements are now prepared in a streaming fashion when a file is first loaded, instead of all at once, which allows referencing a temporary table created at the start of a file in a later statement in the same file.

 fixes #100

* remove temporary table usage

mssql does not have "create temp table"

* mssql permissions fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create and query in the same page
1 participant