Created
March 12, 2020 11:23
-
-
Save motorro/8b77ddfcfa0f49d38f391fe6ff1c816a to your computer and use it in GitHub Desktop.
Calling template
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
async function createDb(): Promise<void> { | |
const db: Database = new Database("db.db"); | |
await populate("app/scr/schemas/1.json", db, function(this: Database): Promise<void> { | |
return new Promise<void>(function(resolve, reject) { | |
this.exec("INSERT INTO `playlists` (id, title, genre) VALUES (1, 'SAMPLE', 'JAZZ')", (err) => { | |
if (err) { | |
reject(err); | |
} else { | |
resolve(); | |
} | |
}); | |
}); | |
}); | |
db.close(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment