Skip to content

fix sql insert syntax#28717

Merged
MattieTK merged 5 commits intocloudflare:productionfrom
updbqn:patch-2
Mar 26, 2026
Merged

fix sql insert syntax#28717
MattieTK merged 5 commits intocloudflare:productionfrom
updbqn:patch-2

Conversation

@updbqn
Copy link
Copy Markdown
Contributor

@updbqn updbqn commented Mar 2, 2026

Summary

"foo@bar.com" is an identifier not a string.

→  insert into example_users values ("foo@bar.com");
Error: failed to execute SQL:
SQLite input error: no such column: foo@bar.com (at offset 34)

updated to single quotes.

Replaces #28698 which I closed accidentally 😅

@elithrar
Copy link
Copy Markdown
Collaborator

elithrar commented Mar 4, 2026

/bonk review this

Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. In SQL, double quotes denote identifiers (column/table names), while single quotes denote string literals. The original "foo@bar.com" causes SQLite to look for a column named foo@bar.com, which fails. Changing to single quotes is the correct fix.

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk bot commented Mar 4, 2026

Approved the PR. The fix is correct: in SQL, double quotes (") are for identifiers while single quotes (') are for string literals. The original code would fail with no such column: foo@bar.com because SQLite interprets "foo@bar.com" as a column reference rather than a string value.

github run

@github-actions
Copy link
Copy Markdown
Contributor

Hey there, we've marked this pull request as stale because there's no recent activity on it. This label is helps us identify PRs that might need updates (or to be closed out by our team if no longer relevant).

@github-actions github-actions bot added the stale label Mar 19, 2026
@MattieTK
Copy link
Copy Markdown
Member

/bonk update this to also point to the latest instructions for tursodb which involve the CLI instructions here https://github.com/tursodatabase/turso (brew install turso) and the binary tursodb not turso

Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The fix correctly changes SQL string literals from double quotes to single quotes. In SQLite, double quotes are for identifiers (column/table names) while single quotes are for string values. The original code would fail with no such column: foo@bar.com.

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk bot commented Mar 26, 2026

Approved. The SQL syntax fix is correct - single quotes are the proper way to denote string literals in SQLite.

github run

@updbqn
Copy link
Copy Markdown
Contributor Author

updbqn commented Mar 26, 2026

/bonk update this to also point to the latest instructions for tursodb which involve the CLI instructions here https://github.com/tursodatabase/turso (brew install turso) and the binary tursodb not turso

Verify that this is actually what you want. Turso db and Turso cloud are not the same thing. I don't think the rest of the guide makes much sense in the context of Turso db.

@MattieTK
Copy link
Copy Markdown
Member

MattieTK commented Mar 26, 2026

/bonk update this to also point to the latest instructions for tursodb which involve the CLI instructions here tursodatabase/turso (brew install turso) and the binary tursodb not turso

Verify that this is actually what you want. Turso db and Turso cloud are not the same thing. I don't think the rest of the guide makes much sense in the context of Turso db.

Understood! Definitely want this to focus on the cloud option, sorry. Fixing this up now to just correct our install options.

Edit: I'll just make these changes separately rather than bundling them in with this which is a nice small change!

Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. This is a correct SQL syntax fix. Double quotes are for identifiers (column/table names) in SQLite, while single quotes are for string literals. The original "foo@bar.com" would cause SQLite to look for a column named foo@bar.com rather than inserting it as a string value.

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk bot commented Mar 26, 2026

Review submitted and approved.

The SQL syntax fix is correct and necessary. In SQLite (which Turso uses), double quotes are reserved for identifiers (column/table names) while single quotes denote string literals. The original code would cause an error because SQLite interprets "foo@bar.com" as a column reference rather than a string value.

github run

@MattieTK MattieTK enabled auto-merge (squash) March 26, 2026 13:40
@MattieTK MattieTK merged commit 4fb49ab into cloudflare:production Mar 26, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:workers Related to Workers product size/xs stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants