WiseLibs / better-sqlite3

The fastest and simplest library for SQLite3 in Node.js.
MIT License
5.4k stars 393 forks source link

Support for the FTS5 extension? #1253

Open mrpengxinwen opened 1 week ago

mrpengxinwen commented 1 week ago

const st1 = db.prepare(SELECT * FROM t_content_idx where t_content_idx match 'a')

it return null ,why? the better-sqlit3 don't support fts5 extenssion?

Prinzhorn commented 1 week ago

By default better-sqlite3 compiles SQLite with SQLITE_ENABLE_FTS5.

Your code produces:

SqliteError: no such table: t_content_idx

Please provide a complete self-contained reproduction using an in-memory db.

import Database from 'better-sqlite3'

const db = new Database(':memory:');

// Your setup code

console.log(db.prepare(`SELECT * FROM t_content_idx where t_content_idx match 'a'`).all());