cloudflare / cloudflare/developer-platform

Errors when running sqlite files with D1 are very unhelpful

Aperta
#13 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
product:d1
Lingua principale
Nessun dato sulla lingua
Stelle
1
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### What versions & operating system are you using?

wrangler 4.26.0, macos

### Please provide a link to a minimal reproduction

_No response_

### Describe the Bug

Here's the output I see now when I have a simple bug in my sql syntax

```
0 ➤ npx wrangler@latest d1 execute pydantic-test --local --file=schema.sql

⛅️ wrangler 4.26.0
───────────────────
🌀 Executing on local database pydantic-test (test) from .wrangler/state/v3/d1:
🌀 To execute on your remote database, add a --remote flag to your wrangler command.

✘ [ERROR] near "limit": syntax error at offset 205: SQLITE_ERROR

If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose
? Would you like to report this error to Cloudflare? Wrangler's output and the error details will be shared with the Wrangler team to help us diagnose and fix the issue. › (Y/n)
```

1. The error gives an offset, not a line number
2. The offset is relative the expression, not the file - making it almost impossible to use!
3. The incorrect code is not show
4. You're constantly suggesting I create issues when I just have an error in my sql syntax

Compare this to the error I get from sqlite:

```
➤ sqlite3 test.edb < schema.sql
Parse error near line 77: near "limit": syntax error
lete old usage beyond one month CHECK (usage <= limit) );
error here ---^
```

### Please provide any relevant error logs

_No response_

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.