cloudflare / cloudflare/developer-platform

Durable Objects Sqlite: Javascript booleans are incorrectly bound as strings

オープン
#12 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
product:durable-objects
主要言語
言語のデータがありません
スター
1
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

説明

### 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_

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

https://github.com/mon/cf-worker-do-bool-bug の最小再現から始め、Durable Objects SQLite exec binding と issue に示されている D1 の結果を比較します。ブール値パラメータの処理を追跡し、Durable Objects の結果がブール値を 0/1 として格納する一方で、その他の実証されたデータ型は変更されないことを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, sqlite
領域
backend, databases
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。