Skip to content
New issue

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

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

Already on GitHub? # to your account

Dynamic or const SQL statements #6

Open
trevyn opened this issue Jan 13, 2021 · 0 comments
Open

Dynamic or const SQL statements #6

trevyn opened this issue Jan 13, 2021 · 0 comments

Comments

@trevyn
Copy link
Owner

trevyn commented Jan 13, 2021

Right now, the select! and execute! macros require a string literal for any raw SQL in your queries, and they do not work with a string slice or constant. You may find this limiting.

Some ideas:

  • Factor the query out into its own function, and re-use that function instead.
  • The Turbosql macro needs to see a string literal, but there could be an outer macro that replaces a token of your choosing with a string literal of your choosing, before it is passed to the Turbosql macro.
  • Ask for a select_unchecked! or similar macro. There are significant downsides to this approach, and there are also certainly cases where it could be useful.
@trevyn trevyn changed the title "I want to be able to use a dynamic or const SQL statement" Dynamic or const SQL statements Jan 13, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant