Skip to content

Feature request: sync schema inspection (one sync schema) #106

@ameet

Description

@ameet

Problem

When writing one sync sql queries, you have to guess at the JSON structure stored in the data column. There's no way to inspect what fields are available, what the nesting looks like, or what types the values are. This leads to trial-and-error with json_extract paths.

For example, to query Gmail thread senders, you need to know the exact path is json_extract(data, '$.messages[0].sender') — but there's no command to discover this.

Proposed solution

A schema inspection command that shows the structure of synced data:

one sync schema gmail/gmailThreads

Output would show the JSON structure with field names, types, and example values:

gmail/gmailThreads (3,926 records)

Top-level fields:
  id              string    "thread_abc123"
  messages        array[object]
    [0].sender    string    "[email protected]"
    [0].subject   string    "Re: Meeting follow-up"
    [0].date      string    "2026-04-14T10:30:00Z"
    [0].snippet   string    "Thanks for the update..."
    [0].body      string    (avg 2,341 chars)
  _identity       string    "[email protected]"
  _synced_at      string    "2026-04-14T22:12:17Z"

Implementation: sample N records (e.g., 10), extract all json_extract paths, infer types, show representative values.

Why this matters

  • Makes one sync sql queries reliable instead of guesswork
  • Helps users understand what data is available before writing queries
  • Especially important when synced data comes from APIs with complex nested responses
  • Enables agents to write correct SQL queries autonomously

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions