Skip to content

Issue on docs - outdated structure of JSON request body for HTTP API #306

@kamrik

Description

@kamrik

Path: /sdk/http/reference

The structure show ins the docs looks like this

{
  "requests": [
    { "type": "execute", "stmt": { "sql": "CREATE TABLE users (name)" } },
    { "type": "close" }
  ]
}

but results in a response with JSON parse error.

It worked ok when I switched to a structure as in this example in tests:
https://github.com/tursodatabase/libsql/blob/7fbef8358b8a504c368cbc1febf7413a0d9271e9/libsql-server/src/http/user/types.rs#L254

{
"statements": [
"select * from test",
{"q": "select ?", "params": [12, true]},
{"q": "select ?", "params": {":foo": "bar"}}
]
}

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