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

Support for prepared statements in SQLite #1117

Closed
Boscop opened this Issue Aug 18, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@Boscop

Boscop commented Aug 18, 2017

SQLite prepared statements (e.g. for preventing SQL injection) can only be defined via the C API, not in raw sql like in postgres. So it can't be done with diesel's sql function:
https://sqlite.org/c3ref/stmt.html
http://jgallagher.github.io/rusqlite/rusqlite/struct.Statement.html

@killercup killercup added the sqlite label Aug 18, 2017

@sgrif

This comment has been minimized.

Member

sgrif commented Aug 18, 2017

I'm not sure what you're asking for? You can provide bind parameters to a query using the .bind. All queries are performed as prepared statements, regardless of backend.

@Boscop

This comment has been minimized.

Boscop commented Aug 18, 2017

Ah, I didn't know that. Thanks!

@Boscop Boscop closed this Aug 18, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment