2.9.1 • Published 4 months ago

libsql-stateless v2.9.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

libsql-stateless

Thin libSQL stateless HTTP driver for TypeScript and JavaScript for the edge 🚀

  • Supported runtime environments: Web API (browser, serverless), Bun, Node.js (>=18)
  • Extremely thin: Has no dependency, only has a few functions that implement the Hrana v3 HTTP protocol from scratch, and has no classes (tend to duplicate memory and/or perform long memory traversals).
  • Does no extra computation.
  • Has no premature optimizations.
  • Is extremely light: 1.15kB (unpacked)* / 548B (gzipped)
  • ✅ Unlike @libsql/client/web, every function performs complete execution in exactly 1 roundtrip.
  • Is built for: Quick stateless query execution. (Mainly for serverless and edge functions.)
  • Supports everything in @libsql/client/web
  • ⚠️ Interactive transactions are not supported because this lib is stateless but transactions are supported.
  • ⚠️ The API provided by libsql-stateless is raw and explicit for reducing (computational and memory) overheads.

* The actual js that is included with your project. (Excluding the type definitions and 2 copies of the main js for esm and cjs. (because you're gonna use one of them))

For easier DX, consider using libsql-stateless-easy instead: it, however, comes with the cost of non-zero-dependency and (computational and memory) overheads potentially unneeded by you. But is still very very very slim compared to @libsql/client.

Why not just use @libsql/client/web?

  1. Not everyone needs stateful DB connection or the overheads that come with it.
  2. To provide a simpler API, @libsql/client/web does a lot of, I'd argue unnecessary, computation under the hood.\ Many people would rather use a more complex API than have worse performance.

Installation

$ npm i libsql-stateless #pnpm, yarn, etc.
# or
$ bun add libsql-stateless

Goto WIKI for Specifications and Examples

API Level

NOTE: <unix_epoch_miliseconds>-HRANA_3_SPEC.md is the current API level.
Downloaded from: https://github.com/tursodatabase/libsql/blob/main/docs/HRANA_3_SPEC.md at <unix_epoch_miliseconds>.
Servers using older API levels may not be compatible. In that case downgrade to an earlier of this package.

2.9.1

4 months ago

2.9.0

5 months ago

2.8.5

6 months ago

2.8.6

5 months ago

2.8.4

8 months ago

2.8.4-alpha.0

8 months ago

2.8.4-alpha.2

8 months ago

2.8.4-alpha.1

8 months ago

2.8.0

8 months ago

2.8.0-alpha.2

8 months ago

2.8.0-alpha.1

8 months ago

2.8.3

8 months ago

2.8.2

8 months ago

2.7.6

9 months ago

2.7.5

9 months ago

2.7.0

1 year ago

2.6.0

1 year ago

2.7.2

1 year ago

2.7.1

1 year ago

2.7.4

1 year ago

2.7.3

1 year ago

2.5.10

1 year ago

2.5.9

1 year ago

2.5.8

1 year ago

2.5.7

1 year ago

2.5.6

1 year ago

2.5.4

1 year ago

2.5.3

1 year ago

2.5.2

1 year ago

2.5.1

1 year ago

2.5.0

1 year ago

2.4.4

1 year ago

2.4.3

1 year ago

2.4.2

1 year ago

2.4.1

1 year ago

2.3.10

1 year ago

2.3.9

1 year ago

2.3.8

1 year ago

2.3.7

1 year ago

2.3.6

1 year ago

2.3.5

1 year ago

2.3.4

1 year ago

2.3.3

1 year ago

2.3.2

1 year ago

2.3.1

1 year ago

2.3.0

1 year ago

2.2.0

1 year ago

2.1.2

1 year ago

2.1.1

1 year ago

2.1.0

1 year ago

2.0.0

1 year ago