Skip to content
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

sqlite-utils query should support named parameters #124

Closed
simonw opened this issue Jul 26, 2020 · 1 comment
Closed

sqlite-utils query should support named parameters #124

simonw opened this issue Jul 26, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Jul 26, 2020

To help out with escaping - so you can run this:

sqlite-utils query "insert into foo (blah) values (:blah)" --param blah `something here`
@simonw simonw added the enhancement New feature or request label Jul 26, 2020
@simonw simonw closed this as completed in 814d4a7 Jul 27, 2020
@simonw
Copy link
Owner Author

simonw commented Jul 27, 2020

Documentation: 814d4a7?short_path=7240b7c#diff-7240b7c71b1a8194da0c001c64fc8d40

You can pass named parameters to the query using -p:

$ sqlite-utils query dogs.db "select :num * :num2" -p num 5 -p num2 6
[{":num * :num2": 30}]

simonw added a commit that referenced this issue Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant