# junochain-sqlite3

> The fastest and simplest library for SQLite3 in Node.js.

Latest version **4.1.2** (published 2018-06-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install junochain-sqlite3
pnpm add junochain-sqlite3
yarn add junochain-sqlite3
bun add junochain-sqlite3
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.1.2 |
| Published | 2018-06-20 |
| First published | 2018-06-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 2.9 MB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Author | Chentm |
| Maintainers | txj2012 |
| Keywords | sql, sqlite, sqlite3, custom, aggregate, database, transactions |

## Links

- npm: https://www.npmjs.com/package/junochain-sqlite3
- Repository: http://pbc.mixislink.com/diffusion/54/junochain-sqlite
- Homepage: http://pbc.mixislink.com/diffusion/54/junochain-sqlite.git
- npm.io page: https://npm.io/package/junochain-sqlite3

## Dependencies (2)

- [integer](https://npm.io/package/integer.md) ^1.0.5
- [bindings](https://npm.io/package/bindings.md) ^1.3.0

## Alternatives

- [@libsql/sqlite3](https://npm.io/package/@libsql/sqlite3.md) — 39.8K weekly downloads
- [@fortemi/core](https://npm.io/package/@fortemi/core.md) — 461 weekly downloads
- [cdb-converter](https://npm.io/package/cdb-converter.md) — 341 weekly downloads
- [@uplo/adapter-prisma](https://npm.io/package/@uplo/adapter-prisma.md) — 75 weekly downloads
- [typeorm-aios](https://npm.io/package/typeorm-aios.md) — 30 weekly downloads

## Recent versions

- 4.1.2 (latest) — 2018-06-20

## README

# better-sqlite3 [![Build Status](https://travis-ci.org/JoshuaWise/better-sqlite3.svg?branch=master)](https://travis-ci.org/JoshuaWise/better-sqlite3)

The fastest and simplest library for SQLite3 in Node.js.

- Full transaction support
- Geared for performance, efficiency, and safety
- Easy-to-use synchronous API *(faster than an asynchronous API... yes, you read that correctly)*
- Custom SQL function support
- 64-bit integer support *(invisible until you need it)*

## How other libraries compare

|   |select 1 row &nbsp;`get()`&nbsp;|select 100 rows &nbsp;&nbsp;`all()`&nbsp;&nbsp;|select 100 rows `iterate()` 1-by-1|insert 1 row `run()`|insert 100 rows in a transaction|
|---|---|---|---|---|---|
|better-sqlite3|1x|1x|1x|1x|1x|
|[sqlite](https://www.npmjs.com/package/sqlite) and [sqlite3](https://www.npmjs.com/package/sqlite3)|8.4x slower|3.7x slower|28.2x slower|3.6x slower|6.0x slower|

> You can verify these results by [running the benchmark yourself](https://github.com/JoshuaWise/better-sqlite3/wiki/Benchmark).
> *Both [npm/sqlite](https://www.npmjs.com/package/sqlite) and [npm/sqlite3](https://www.npmjs.com/package/sqlite3) have nearly identical performance because they both use the [same engine](https://github.com/mapbox/node-sqlite3).*

## Installation

```bash
npm install --save better-sqlite3
```

> If you have trouble installing, check the [troubleshooting guide](https://github.com/JoshuaWise/better-sqlite3/wiki/Troubleshooting-installation).

## Usage

```js
var Database = require('better-sqlite3');
var db = new Database('foobar.db', options);

var row = db.prepare('SELECT * FROM users WHERE id=?').get(userId);
console.log(row.firstName, row.lastName, row.email);
```

## Why should I use this instead of [node-sqlite3](https://github.com/mapbox/node-sqlite3)?

- `node-sqlite3` uses asynchronous APIs for tasks that are either CPU-bound or serialized. That's not only bad design, but it wastes tons of resources. It also causes [mutex thrashing](https://en.wikipedia.org/wiki/Resource_contention) which has devastating effects on performance.
- `node-sqlite3` exposes low-level (C language) memory management functions. `better-sqlite3` does it the JavaScript way, allowing the garbage collector to worry about memory management.
- `better-sqlite3` is simpler to use, and it provides nice utilities for some operations that are very difficult or impossible in `node-sqlite3`.
- `better-sqlite3` is much faster than `node-sqlite3` in most cases, and just as fast in all other cases.

# Documentation

- [API documentation](https://github.com/JoshuaWise/better-sqlite3/wiki/API)
- [Performance](https://github.com/JoshuaWise/better-sqlite3/wiki/Performance) (also see [benchmark results](https://github.com/JoshuaWise/better-sqlite3/wiki/Benchmark))
- [64-bit integer support](https://github.com/JoshuaWise/better-sqlite3/wiki/64-bit-integer-support)
- [SQLite3 compilation options](https://github.com/JoshuaWise/better-sqlite3/wiki/SQLite3-compilation-options)

# License

[MIT](https://github.com/JoshuaWise/better-sqlite3/blob/master/LICENSE)

---
_Source: https://npm.io/package/junochain-sqlite3 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
