manyuanrong / manyuanrong/sql-builder
comma between multiple insert VALUES missing?
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 55
- Forks
- 15
- PR merge metrics
- No merged PRs in 30d
Description
I'm not sure about this, also pretty new to SQLite and it's been pretty long in general since I dealt with SQL, though I get the same error trying to run the produced query in "DB Browser for SQLite" desktop app which I only resolve by adding a comma between the multiple VALUES `),(`
```
SqliteError: near "(": syntax error
at DB.prepareQuery (https://deno.land/x/sqlite@v3.4.0/src/db.ts:250:13)
```
because the builder generates `) (`
```
INSERT INTO `users` (`id`,`name`,`email`,`password`) VALUES ("ID1","name","email","hashedpwd") ("id2","name2","email2","pwHash")
```
strange, when trying to fix this in a local fork I get another error that there's no such column which then refers to a value, though copying the exact statement into DB Browser works as expected
also this lib doesn't seem to be really maintained 😬
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the multi-row INSERT shown in the issue and inspect the SQL-builder entry point that produces it; src/db.ts:250:13 is where preparation reports the syntax error. Confirm the generated statement is valid SQLite with multiple VALUES groups separated correctly, then rerun the same insert to verify it prepares successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sqlite, typescript
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100