0.1.1 • Published 4 months ago

scout-sqlite v0.1.1

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

Scout-sqlite

I am Looking for your feedback in Feedback issue.

Currently tools like Drizzle ORM, Kysely 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 for how to generate a new token.

Config for remote database

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.

TURSO_DATABASE_URL=file:./<path to file>

Install the scout-sqlite cli using your favourite package manager

package managercommand
npmnpm install scout-sqlite -D
pnpmpnpm add scout-sqlite -D
yarnyarn add scout-sqlite -D
bunbun install scout-sqlite

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

[
  {
    "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
0.1.1

4 months ago

0.1.0

4 months ago

0.0.3

5 months ago

0.0.2

5 months ago

0.0.1

5 months ago