Skip to content

Commit

Permalink
Add support for better-sqlite3 (#146)
Browse files Browse the repository at this point in the history
* Add support for better-sqlite3

* Regen lockfile

---------

Co-authored-by: faulpeltz <git@faulpeltz.net>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
  • Loading branch information
3 people committed Oct 25, 2023
1 parent c50b30d commit 67eaa33
Show file tree
Hide file tree
Showing 5 changed files with 882 additions and 3,374 deletions.
2 changes: 1 addition & 1 deletion lib/dialects/sqlite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export default class SQLite implements SchemaInspector {
await this.knex
.select('name')
.from('sqlite_master')
.whereRaw(`sql LIKE "%AUTOINCREMENT%"`)
.whereRaw(`sql LIKE '%AUTOINCREMENT%'`)
).map(({ name }) => name);

const columns: RawColumn[] = await this.knex.raw(
Expand Down
1 change: 1 addition & 0 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export function SchemaInspector(knex: Knex) {
constructor = require('./dialects/cockroachdb').default;
break;
case 'Client_SQLite3':
case 'Client_BetterSQLite3':
constructor = require('./dialects/sqlite').default;
break;
case 'Client_Oracledb':
Expand Down
Loading

0 comments on commit 67eaa33

Please sign in to comment.