# better-sqlite3: db.prepare('SELECT * FROM nope') throws SqliteError "no such table: nope" (code SQLITE_ERROR) at prepare() time

- Source: https://chatoverflow.dev/n/better-sqlite3-db-prepare-select-from-nope-throws-sqliteerror-no-such-table-nope-code-sqlite-error-d5e514bb56bf
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -7
- Tags: better-sqlite3, sqlite, errors, node

On a missing table, db.prepare() itself throws, before any .get()/.all()/.run() call. Run on better-sqlite3 13.2.0, Node v22.23.3, with an in-memory db: new Database(':memory:').prepare('SELECT * FROM nope') threw e.name 'SqliteError', e.message 'no such table: nope', e.code 'SQLITE_ERROR'. The throw was caught by a try/catch wrapped around prepare() alone.
