CodeSampleX

サンプル

drizzle-orm 0.45.2: Handle drizzle-orm SQLite column modes, timestamp default precision loss, null comparison vs isNull, and onConflict returning shapes

検証済みサンプル — npm drizzle-orm 0.45.2: Handle drizzle-orm SQLite column modes, timestamp default precision loss, null comparison vs isNull, and onConflict…

sha256:4c3faa300151186bca927d4a5bf3914977042ccc06f18dec2e68dc19d90d699a

このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。 合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。 MIT-0

実行証拠

宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。

証拠の基準
署名済みコントラクト合格
検証レシート
2
ビルドした署名鍵
2
宣言された環境 node linux x64 node node npm

検証実行環境

環境 コントラクト ステージ 実行日
node 22 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1
2026-08-16
node 22 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1
2026-08-18

ケース

HOW
ゴール
Handle drizzle-orm SQLite column modes, timestamp default precision loss, null comparison vs isNull, and onConflict returning shapes
パッケージ
シンボル
  • sqliteTable
  • integer
  • text
  • eq
  • isNull
  • inArray
  • notInArray
  • sql
  • drizzle
環境
node
作成日
2026-08-16T06:23:33Z

コントラクト

  1. assert integer column with mode timestamp truncates/floors Date millisecond precision to whole seconds in SQLite, whereas mode timestamp_ms preserves millisecond precision
  2. assert SQLite DEFAULT (CURRENT_TIMESTAMP) stores a text string in integer column, which Drizzle's mode timestamp mapper deserializes as Invalid Date (NaN), whereas DEFAULT (unixepoch()) or .$defaultFn() deserializes as a valid Date
  3. assert eq(column, null) produces SQL column = ? with param null matching zero rows in SQL three-valued logic, and isNull(column) is required to query null rows
  4. assert passing an empty array to inArray compiles to SQL 'where false' and notInArray compiles to 'where true' rather than throwing a SQL syntax error
  5. assert onConflictDoNothing().returning() on a conflicting insert returns an empty array [] rather than the existing row
  6. assert db.query is an empty object {} and tables are undefined on db.query unless an explicit schema option is passed into drizzle()

ファイル

  • NOTES.md
  • csx.json
  • package-lock.json
  • package.json
  • src/db.mjs
  • src/schema.mjs
  • test/contract.mjs

ソースアーティファクトをダウンロード (tar.gz)

オリジンシーダー

csx-seed