• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

joaoh82 / rust_sqlite / 25093849524
69%

Build:
DEFAULT BRANCH: main
Ran 29 Apr 2026 06:18AM UTC
Jobs 1
Files 31
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

29 Apr 2026 06:15AM UTC coverage: 69.044% (-1.9%) from 70.927%
25093849524

push

github

web-flow
Phase 7e: JSON column type + path queries (#54)

Adds the JSON storage class and four path-aware query functions, closing
the second of Phase 7's two storage primitives (the first was VECTOR(N)
in 7a). Shape mirrors SQLite's JSON1 extension — JSON values store as
canonical UTF-8 text, validated via `serde_json::from_str` at INSERT and
UPDATE time. Phase 7 plan Q3 originally proposed bincoded `serde_json::
Value`, but bincode was removed from the engine in Phase 3c (cell-based
encoding replaced it); rather than re-add bincode for one column type,
JSON-as-text matches SQLite's choice and reuses the existing Text storage
path. Q3 in `docs/phase-7-plan.md` records the scope correction inline.

Engine surface:

- `DataType::Json` variant alongside `Vector(N)`. `JSONB` parses as an
  alias (Postgres convention; both store as text in our case).
- INSERT/UPDATE on a JSON column runs `serde_json::from_str::<Value>`;
  malformed JSON is rejected with `Type mismatch: expected JSON for
  column 'foo': <serde error>`. NULLs pass through untouched.
- UNIQUE on a JSON column treats the value as raw text (string equality
  on the canonical form).
- `table_to_create_sql` round-trips JSON columns; `build_empty_table`,
  `Row::Text(BTreeMap::new())` storage, and the `clone_datatype` helpers
  in `executor.rs` and `pager/mod.rs` all gained the new arm.

Functions (executor.rs, ~370 LOC):

- `json_extract(json[, path])` — walks the path, returns the resolved
  node coerced to the closest SQL type. Strings → TEXT, numbers →
  INTEGER/REAL, booleans → BOOLEAN, `null` → NULL, composites
  (object/array) → canonical JSON text.
- `json_type(json[, path])` — returns one of `'object'`, `'array'`,
  `'string'`, `'integer'`, `'real'`, `'true'`, `'false'`, `'null'`.
- `json_array_length(json[, path])` — element count; errors if the
  resolved node isn't an array.
- `json_object_keys(json[, path])` — keys as a JSON-array text in
  insertion order (e.g. `'["a","b","c"]'`). Diverges f... (continued)

154 of 210 new or added lines in 5 files covered. (73.33%)

227 existing lines in 3 files now uncovered.

5382 of 7795 relevant lines covered (69.04%)

1.42 hits per line

Uncovered Changes

Lines Coverage ∆ File
44
74.02
-1.26% src/sql/executor.rs
5
71.57
0.16% src/sql/db/table.rs
5
92.66
-0.19% src/sql/mod.rs
2
89.34
-0.05% src/sql/pager/mod.rs

Coverage Regressions

Lines Coverage ∆ File
127
15.43
-2.18% src/lib.rs
98
18.88
-4.11% src/error.rs
2
89.34
-0.05% src/sql/pager/mod.rs
Jobs
ID Job ID Ran Files Coverage
1 25093849524.1 29 Apr 2026 06:18AM UTC 31
69.04
GitHub Action Run
Source Files on build 25093849524
  • Tree
  • List 31
  • Changed 7
  • Source Changed 0
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • a2ad2adc on github
  • Prev Build on main (#25079732301)
  • Next Build on main (#25133039769)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc