Skip to content

Add JSON driver for reading and writing structured data #72

Closed

Description

@ejboy

Implement a JSON driver supporting JSON → database, database → JSON, and JSON → JSON transformations.

Reading

  • Read a root JSON array, optionally selecting an array through a simple nested path.
  • Expose each item as row, with objects represented as maps and arrays as lists.
  • Preserve scalar types and nulls.
  • Reuse existing expressions for field access, including nested fields, array indexes, and keys containing periods:
INSERT INTO customers (name, price)
VALUES (?{row.customer.name}, ?{row.items[0].price});

Literal keys containing periods can use bracket access: ?{row['customer.name']}.

Define and document behavior for missing fields and invalid paths.

Writing

  • Each JSON script execution supplies one structured object.
  • Serialize objects into an output JSON array.
  • Support field mappings for renaming fields and constructing nested objects.
  • Handle string escaping, scalar types, nulls, commas, and array delimiters automatically.
  • Define the mapping syntax during implementation; avoid requiring users to construct JSON through text substitution.

Scope

Full JSONPath, JSON Lines, and schema validation are deferred. Include examples covering reading, writing, and transformation, with documented memory usage and output behavior on failure.

Supersedes #8 with a defined MVP scope.

Implementation plan

Private working plan and proposed ETL examples are tracked in the registered
experiments-private repository. RepoLink reference:

repolink experiments-private/scriptella/json-driver-mvp/implementation-plan.md

Locate the checkout with repolink get experiments-private, then open
scriptella/json-driver-mvp/implementation-plan.md. The plan includes phased
implementation, JSON-shaped output templates with typed ?{...} placeholders,
and a conditional assessment of JSON Lines support. It is a design draft;
remaining scope decisions are recorded there.

Activity

  1. added this to the 1.7.0 milestone on Oct 21, 2026
  2. ejboy commented on Oct 25, 2026

    @ejboy
    MemberAuthor

    Implemented and validated for the upcoming 1.7.0 release; not yet released.

    The JSON/JSON Lines driver, typed output templates, documentation and packaged examples are complete (implementation commits 1a84e33, 803c6b3, 21cdede; distribution/documentation acceptance ffda0ce; final documentation clarification 7b8e685).

    Validation recorded in the implementation plan includes Java 17 Maven and Ant suites (439 tests each), distribution assembly and optional-runtime contracts, and all four JSON/JSONL examples executed through both assembled distributions. Subsequent CI at fed3f65 also passed Maven tests and Ant package contracts on Java 17 and 25: https://github.com/scriptella/scriptella-etl/actions/runs/39659867071

    Release publication, website/provider documentation, released example links and final tagged-artifact checks remain tracked in #70. Closing as completed; retaining the 1.7.0 milestone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions