# scout-sqlite

> manage fts5 indexes in your turso/sqlite/libsql db

Latest version **0.1.1** (published 2024-07-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install scout-sqlite
pnpm add scout-sqlite
yarn add scout-sqlite
bun add scout-sqlite
```

Provides the command `scout`.

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2024-07-15 |
| First published | 2024-06-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 8.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | JayJamieson |
| Maintainers | jayjamieson |
| Keywords | SQLite, fts5, turso, libsql, search |

## Links

- npm: https://www.npmjs.com/package/scout-sqlite
- Repository: https://github.com/JayJamieson/scout-sqlite
- Homepage: https://github.com/JayJamieson/scout-sqlite#readme
- Issues: https://github.com/JayJamieson/scout-sqlite/issues
- npm.io page: https://npm.io/package/scout-sqlite

## Dependencies (4)

- [find-up](https://npm.io/package/find-up.md) ^7.0.0
- [commander](https://npm.io/package/commander.md) ^12.1.0
- [@libsql/client](https://npm.io/package/@libsql/client.md) ^0.6.2
- [sqlite-fts-util](https://npm.io/package/sqlite-fts-util.md) ^1.0.6

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2024-07-15
- 0.1.0 — 2024-07-15
- 0.0.3 — 2024-07-11
- 0.0.2 — 2024-06-16
- 0.0.1 — 2024-06-16

## README

# Scout-sqlite

> I am Looking for your feedback in [Feedback](https://github.com/JayJamieson/scout-sqlite/issues/1) issue.

Currently tools like [Drizzle ORM](https://orm.drizzle.team/docs/overview), [Kysely](https://kysely.dev/docs/intro) don't support SQLite FTS index creation through table definitions. Scout-sqlite aims to bridge that gap by helping create and manage FTS index creation by generating and applying the SQL for you.

## Getting Started

Ensure your turso databse URL and token are configured. See TS quick [start guide](https://docs.turso.tech/sdk/ts/quickstart) for how to generate a new token.

### Config for remote database

```env
TURSO_DATABASE_URL=
TURSO_AUTH_TOKEN=
```

### Config for local database

We can apply to a local database file by specifiying a local path instead of remote URL and skip `TURSO_AUTH_TOKEN`.

```env
TURSO_DATABASE_URL=file:./<path to file>
```

Install the `scout-sqlite` cli using your favourite package manager

| package manager | command |
| --------------- | ------- |
| npm | `npm install scout-sqlite -D` |
| pnpm | `pnpm add scout-sqlite -D` |
| yarn | `yarn add scout-sqlite -D` |
| bun | `bun install scout-sqlite` |

Initialize an empty configuration file with `npx scout init`. This creates a `sqlitefts5rc.json` file in the current working directory.

```json
[
  {
    "table": "YOUR TABLE HERE",
    "idColumn": "YOUR TABLE HERE",
    "columns": [
      "YOUR",
      "COLUMNS",
      "HERE"
    ]
  }
]
```

Replace place holder text with your own values then run `npx scout apply` to create the FTS5 indexes and management triggers.

- If you're using a local file then use `-l` or `--local` flag to bypass `TURSO_AUTH_TOKEN` requirement.

## Roadmap

- Handle updates of existing indexes and triggers

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