cloudflare / cloudflare/developer-platform
Durable Objects Sqlite: Javascript booleans are incorrectly bound as strings
- 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.24.3, node v23.11.0, macOS Sonoma
### Please provide a link to a minimal reproduction
https://github.com/mon/cf-worker-do-bool-bug
### Describe the Bug
When binding a javascript boolean to a sqlite `exec` call in a Durable Object, the value is serialised as the string value of the boolean instead of 0/1 as it is in D1.
This appears to be the only datatype with this issue.
From the linked repro case - note that only the `bool` column differs:
```
D1 select result: {
n: null,
integer: 123,
real: 123.456,
text: 'hello',
blob: 'world',
numeric: 5.3,
bool: 1,
bool2: 1
}
DO select result: {
n: null,
integer: 123,
real: 123.456,
text: 'hello',
blob: 'world',
numeric: 5.3,
bool: 'true',
bool2: 1
}
```
### Please provide any relevant error logs
_No response_
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Start with the minimal reproduction at https://github.com/mon/cf-worker-do-bool-bug and compare the Durable Objects SQLite exec binding with the D1 result shown in the issue. Trace boolean parameter handling and verify that the Durable Objects result stores booleans as 0/1 while the other demonstrated datatypes remain unchanged.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, sqlite
- Ambito
- backend, databases
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100