tursodatabase / tursodatabase/libsql

future of the http api v0

Open
#566 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
17.2k
Forks
531
Avg merge
1h 12m
Merged PRs (30d)
1

Description

Background

i needed something that executes the most number of remote SQL queries with the least number of http requests. (i dont care about transactions)
on reading the hrana http api specs, i discovered that http api v2 makes multiple http reqs to achieve statefulness.
fortunately http api v0 seems like LTS and is exactly what i needed.
but http api v0's docs were extremely bad/out of date.
so i had to read through the libsql-server source code to figure out the query routes and req and res json structures.
after this i made an npm package to make this api widely available to the js/ts ecosystem: https://www.npmjs.com/package/libsql-web-api-http-stateless-client
and made a few pulls [https://github.com/tursodatabase/libsql/pull/550, https://github.com/tursodatabase/libsql/pull/555] to update the http api v0 docs to whatever was happening in the libsql-server/src

The HTTP API V0 is Important

  1. with all rapid changes/improvements to the hrana protocol, we need http api v0 as the final fallback (which i guess was the original intention: "It does not deprecate or replace the "version 0" of the HTTP API, which is designed to be quick and easy for users who send HTTP requests manually" ~https://github.com/tursodatabase/libsql/blob/main/libsql-server/docs/HTTP_V1_SPEC.md:9)
  2. its extremely simple: both to use and to run on the libsql server
    This makes it usable with manual use of curl.
  3. it is fast and takes 1req 1res approach

Current Condition

http api v0 seems like a very unmaintained api (i'd like to help change that (mainly because i intend to use it in one of my large projects))

Request For Comments

What are your thoughts/opinions/plans on the http api v0?
Is it LTS? If not, shouldn't we make it LTS?

Quick Links
  1. current (inaccurate/outdated) docs: https://github.com/tursodatabase/libsql/blob/main/libsql-server/docs/http_api.md
  2. current server-side implementation: https://github.com/tursodatabase/libsql/blob/0c7cfdace9c5a75617072da7587c011be01bf893/libsql-server/src/http/user/mod.rs#L339

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with libsql-server/docs/http_api.md and the server implementation at libsql-server/src/http/user/mod.rs around line 339. Compare the documented routes and request/response JSON with the implementation, and review the linked documentation pull requests. Done means an explicit decision on HTTP API v0's maintenance or LTS status and, if retained, documentation that matches its supported behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, rust, sql, typescript
Domain
api, backend, documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.