Skip to content

start implementing CBOR and JSON streaming modes for httpQuery - #219

Draft
conradludgate wants to merge 7 commits into
mainfrom
conrad/sql-streaming-protocol
Draft

start implementing CBOR and JSON streaming modes for httpQuery#219
conradludgate wants to merge 7 commits into
mainfrom
conrad/sql-streaming-protocol

Conversation

@conradludgate

@conradludgate conradludgate commented Aug 10, 2026

Copy link
Copy Markdown

This is a WIP to experiment with streaming responses for httpQuery. DO NOT MERGE.

This implements streaming via jsonlines.

streaming is only at the network layer, application layer still waits for all rows

example data format

before:

{
  "results": [
    {
      "fields": [
        { "name": "id", "dataTypeID": 23, "...": "..." },
        { "name": "name", "dataTypeID": 25, "...": "..." }
      ],
      "rows": [
        ["1", "Ada"],
        ["2", "Grace"]
      ],
      "command": "SELECT",
      "rowCount": 2,
      "rowAsArray": true
    },
    {
      "fields": [
        { "name": "active", "dataTypeID": 16, "...": "..." }
      ],
      "rows": [
        ["t"],
        ["f"]
      ],
      "command": "SELECT",
      "rowCount": 2,
      "rowAsArray": true
    }
  ]
}

after:

{"fields":[{"name":"id","dataTypeID":23,"...":"..."},{"name":"name","dataTypeID":25,"...":"..."}]}
"1"
"Ada"
"2"
"Grace"
{"command":"SELECT","rowCount":2}
{"fields":[{"name":"active","dataTypeID":16,"...":"..."}]}
"t"
"f"
{"command":"SELECT","rowCount":2}
{}

Comment thread src/httpQuery.ts
) {
throw new Error(
'Database connection string format for `neon()` should be: postgresql://user:password@host.tld/dbname?option=value',
'Database connection string format for `neon()` should be: postgresql://user@host.tld/dbname?option=value',

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change will be reverted, git hooks were blocking me from pushing this "secret"

@conradludgate
conradludgate force-pushed the conrad/sql-streaming-protocol branch 2 times, most recently from 6741f42 to 6389fe3 Compare August 18, 2026 20:16
@conradludgate
conradludgate force-pushed the conrad/sql-streaming-protocol branch from 6389fe3 to bbf88e5 Compare August 19, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant