Skip to content

Instantly share code, notes, and snippets.

@Myllaume
Created July 3, 2022 13:04
Show Gist options
  • Save Myllaume/c36df1c8593234012211b440c32f6a06 to your computer and use it in GitHub Desktop.
Save Myllaume/c36df1c8593234012211b440c32f6a06 to your computer and use it in GitHub Desktop.
Use node-sqlite3 with Typescript
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;
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