-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexe12.mjs
More file actions
17 lines (16 loc) · 783 Bytes
/
exe12.mjs
File metadata and controls
17 lines (16 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { Database } from "./database.mjs";
(async function(){
try {
let database = new Database();
await database.execute("create table author (id number, name string, age number, city string, state string, country string)");
await Promise.all([
database.execute("insert into author (id, name, age) values (1, Douglas Crockford, 62)"),
database.execute("insert into author (id, name, age) values (2, Linus Torvalds, 47)"),
database.execute("insert into author (id, name, age) values (3, Martin Fowler, 54)"),
]);
const result = await database.execute("select name, age from author");
console.log(JSON.stringify(result, undefined, " "));
} catch (e) {
console.log(e);
}
})();