Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

SQL runtime errors are missing Result Codes #604

Closed
WilsonNet opened this issue Aug 15, 2023 · 2 comments
Closed

SQL runtime errors are missing Result Codes #604

WilsonNet opened this issue Aug 15, 2023 · 2 comments

Comments

@WilsonNet
Copy link

If I run

docker run -p 8080:8080 ghcr.io/libsql/sqld:latest

To create an instance of sqld, and then

curl --location 'http://127.0.0.1:8080' \
--header 'Content-Type: application/json' \
--data '{
    "statements": [
        {
            "q": "create table t(x int);"
        }
    ]
}'

I get the error, without the Result Code:

[{"error":"table t already exists in create table t(x int); at offset 13"}]

The above should yield the SQLite code and error message:

SQL_INPUT_ERROR
SQL input error: table t already exists (at offset 13)

See more at the original issue in libsql-shell-go.git:
tursodatabase/libsql-shell-go#128

@CodingDoug
Copy link
Contributor

This is using the legacy HTTP interface and has been superceded by newer protocols. It's been discussed that we might even completely drop support for it since it lacks important features (such as the error code you're looking for), and isn't used at all by modern versions of our client libraries.

@MarinPostma
Copy link
Contributor

closing this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants