Skip to content

Commit c9363be

Browse files
Fix SQLite Decimal and Date32/64 insertion/retrieval (#517)
* Revert "Properly handle decoding decimals from SQLite using the decimal extension (#504)" This reverts commit df8eeb1. * Remove decimal test - its invalid * Revert "Add roundtrip test and fix Decimal support" This reverts commit b9e3c14. * Use spiceai fork of sea-query * fix(sqlite): store Date32/Date64 as ISO-8601 strings in insert_batch_prepared The insert_batch_prepared function was storing Date32/Date64 values as Unix timestamps (e.g., 751248000), while the non-batch insert_batch function (via InsertBuilder) correctly stores them as ISO-8601 date strings (e.g., '1993-10-22'). When reading data back, the SQLite table provider expects date columns to contain ISO-8601 formatted strings for proper parsing/casting back to Arrow Date32 types. The Unix timestamp values failed to parse, resulting in NULL/empty date values. This change updates insert_batch_prepared to convert Date32/Date64 values to ISO-8601 strings using time::OffsetDateTime, matching the behavior of InsertBuilder::construct_insert_stmt. * Remove unneeded test
1 parent 4a9f784 commit c9363be

8 files changed

Lines changed: 42 additions & 597 deletions

File tree

Cargo.lock

Lines changed: 5 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,14 @@ fundu = "2.0.1"
8282
geo-types = "0.7.13"
8383
sha2 = "0.10"
8484
hickory-resolver = "0.25.2"
85-
sea-query = { version = "0.32", features = [
86-
"backend-sqlite",
87-
"backend-postgres",
88-
"postgres-array",
89-
"with-rust_decimal",
90-
"with-bigdecimal",
91-
"with-time",
92-
"with-chrono",
85+
sea-query = { git = "https://github.com/spiceai/sea-query.git", rev = "213b6b876068f58159ebdd5852604a021afaebf9", features = [
86+
"backend-sqlite",
87+
"backend-postgres",
88+
"postgres-array",
89+
"with-rust_decimal",
90+
"with-bigdecimal",
91+
"with-time",
92+
"with-chrono",
9393
] }
9494

9595
[patch.crates-io]

0 commit comments

Comments
 (0)