Created
July 3, 2022 13:04
-
-
Save Myllaume/c36df1c8593234012211b440c32f6a06 to your computer and use it in GitHub Desktop.
Use node-sqlite3 with Typescript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Database } from 'sqlite3'; | |
import { SqliteTable, SqliteColumn } from '../types'; | |
const db = new Database('database.db', (err) => { | |
if (err) { | |
console.log("Getting error " + err); | |
} else { | |
console.log('database ok'); | |
} | |
}); | |
export default db; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm i sqlite3 | |
npm i -D @types/sqlite3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment