PACKAGE · SERVERLESS DATABASE

@libsql/client

libSQL driver for TypeScript and JavaScript

WEEKLY DOWNLOADS 612.9K
STARS 559
FORKS 64
OPEN ISSUES 120
GZIP SIZE 37.8 kB
UNPACKED SIZE 140.1 kB
LAST UPDATED 4mo ago
DOWNLOAD TRENDS

@libsql/client downloads — last 12 months

Download trends for @libsql/client1 download series from Jun 2025 to May 2026. Use left and right arrow keys to inspect monthly values.01.1M2.2M3.3M4.3MJun 2025SepDecMarMay 2026
@libsql/client
ABOUT @LIBSQL/CLIENT

The @libsql/client package provides a robust driver for interacting with `libSQL`, an embedded database built for the edge. It bridges the gap between traditional relational databases and modern JavaScript/TypeScript applications, offering features like full SQL support, ACID transactions, and a familiar API. This driver aims to simplify database operations for developers working with modern web frameworks and serverless architectures, allowing them to leverage SQL within their JavaScript or TypeScript projects without complex setup.

The core philosophy behind this client is to provide a seamless and type-safe database experience for JavaScript and TypeScript developers. It caters particularly to those building applications on platforms where a traditional server-based database might be overkill or not feasible, such as edge functions, serverless environments, or even desktop applications. The driver prioritizes developer ergonomics with well-defined interfaces and excellent TypeScript support, making it easy to integrate into existing projects.

Key API patterns revolve around a familiar SQL client interface. Developers can execute arbitrary SQL queries using methods like `execute`. The client supports both synchronous and asynchronous operations, and its design facilitates handling query results efficiently, including support for prepared statements and transactions. This allows for complex data manipulation and retrieval using standard SQL syntax within your application code.

Integration points are broad, extending to popular frameworks like Next.js, SvelteKit, and other Node.js environments. Its client-side capabilities also make it suitable for use in browser-based applications or Electron apps where a local, file-based database is desired. The package is designed to fit into CI/CD pipelines and development workflows that favor embedded or edge data storage solutions.

With a reported gzip bundle size of 22.9 kB, the client is relatively lightweight, making it suitable for performance-sensitive applications and environments with limited bandwidth. While the package is actively maintained, its features are built upon `libSQL`, which itself is a fork of SQLite with additional features, suggesting a solid foundation. Developers should note that while it offers SQL compatibility, specific advanced SQLite extensions might not be directly exposed through this driver without further investigation.

One potential consideration is the management of database files, especially in serverless environments where ephemeral storage can be a concern. Developers need to plan for persistence strategies when using `libSQL` in such contexts. Additionally, understanding the operational characteristics of `libSQL` itself, particularly regarding concurrency and scaling limitations compared to client-server relational databases, is important for long-term architecture decisions.

WHEN TO USE
  • When building serverless applications that require persistent SQL data storage accessible from edge functions.
  • When integrating a local, file-based SQL database into a desktop application using Electron.
  • When developing frontend applications that need direct, type-safe access to a local SQLite database without a backend server.
  • When migrating existing SQLite databases to modern JavaScript/TypeScript projects with minimal friction.
  • When leveraging React Server Components or similar SSR/RSC architectures for localized data access within the component tree.
  • When requiring ACID-compliant transactions for imperative data modification in JavaScript/TypeScript applications.
WHEN NOT TO USE
  • If your primary need is a distributed, highly available relational database for large-scale, multi-region deployments; consider managed cloud SQL services instead.
  • If you only require simple key-value storage; native browser `localStorage` or `sessionStorage` might be more appropriate.
  • When building a backend API that needs to handle high concurrency and complex joins across massive datasets; a dedicated client-server database system is typically better suited.
  • If your application exclusively interacts with a remote database via an ORM and doesn't require direct SQL execution or local data capabilities.
  • If you need to integrate with specific PostgreSQL or MySQL-only features or extensions not present in SQLite-based databases.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 3
@libsql/client vs @planetscale/database ★ 1.2K · 100.8K/wk @libsql/client vs @tursodatabase/serverless ★ 0 · 9.6K/wk @libsql/client vs @neondatabase/serverless ★ 527 · 1.3M/wk