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

Avoid using params for schema statements #90

Merged
merged 3 commits into from
Jan 2, 2025
Merged

Avoid using params for schema statements #90

merged 3 commits into from
Jan 2, 2025

Conversation

leo
Copy link
Member

@leo leo commented Jan 1, 2025

SQLite does not support statement parameters in schema statements, which is currently blocking a different PR, so we have to stop using them for indexes and triggers.

Since schema-altering statements like trigger creation, index creation and so on are anyways not run by end-users, the SQLite team likely intentionally didn't want to prevent SQL injections here. Those kinds of queries are also not run repeatedly, so the performance optimization of needing to prepare statements with different values is also not helpful in those cases.

@leo leo added the enhancement New feature or request label Jan 1, 2025
@leo leo requested review from NuroDev, juriadams and colodenn January 1, 2025 16:57
Copy link

github-actions bot commented Jan 1, 2025

Released an experimental package:

bun add @ronin/compiler@leo-ron-1071-experimental-292

This package will be removed after the pull request has been merged.

Copy link

codecov bot commented Jan 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
src/utils/model.ts 100.00% <100.00%> (ø)

@leo leo changed the title Avoid using variables in triggers Stop using params for schema statements Jan 2, 2025
@leo leo changed the title Stop using params for schema statements Stop using params for DDL statements Jan 2, 2025
@leo leo changed the title Stop using params for DDL statements Stop using params for schema statements Jan 2, 2025
@leo leo marked this pull request as ready for review January 2, 2025 08:19
@leo leo enabled auto-merge (squash) January 2, 2025 08:20
@leo leo changed the title Stop using params for schema statements Avoid using params for schema statements Jan 2, 2025
@leo leo disabled auto-merge January 2, 2025 08:20
@leo leo enabled auto-merge (squash) January 2, 2025 08:20
@leo leo merged commit ec1deab into main Jan 2, 2025
4 checks passed
@leo leo deleted the leo/ron-1071 branch January 2, 2025 08:22
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

Successfully merging this pull request may close these issues.

2 participants