2.8.4 • Published 2 months ago

libsql-stateless v2.8.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 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: 12.1kB (unpacked)/ 4.3kB (package)/ 1.4kB (minified)/ 662B (minified+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.

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.8.4

2 months ago

2.8.4-alpha.0

2 months ago

2.8.4-alpha.2

2 months ago

2.8.4-alpha.1

2 months ago

2.8.0

2 months ago

2.8.0-alpha.2

2 months ago

2.8.0-alpha.1

2 months ago

2.8.3

2 months ago

2.8.2

2 months ago

2.7.6

3 months ago

2.7.5

3 months ago

2.7.0

8 months ago

2.6.0

8 months ago

2.7.2

7 months ago

2.7.1

8 months ago

2.7.4

7 months ago

2.7.3

7 months ago

2.5.10

8 months ago

2.5.9

8 months ago

2.5.8

8 months ago

2.5.7

8 months ago

2.5.6

8 months ago

2.5.4

8 months ago

2.5.3

8 months ago

2.5.2

8 months ago

2.5.1

8 months ago

2.5.0

8 months ago

2.4.4

8 months ago

2.4.3

8 months ago

2.4.2

8 months ago

2.4.1

8 months ago

2.3.10

8 months ago

2.3.9

8 months ago

2.3.8

8 months ago

2.3.7

8 months ago

2.3.6

8 months ago

2.3.5

8 months ago

2.3.4

8 months ago

2.3.3

8 months ago

2.3.2

8 months ago

2.3.1

8 months ago

2.3.0

8 months ago

2.2.0

8 months ago

2.1.2

8 months ago

2.1.1

8 months ago

2.1.0

8 months ago

2.0.0

8 months ago