回答編集履歴
1
type
answer
CHANGED
@@ -7,10 +7,10 @@
|
|
7
7
|
co(function*(){
|
8
8
|
const sqlite3 = require("sqlite3").verbose();
|
9
9
|
const db = new sqlite3.Database('db.sqlite3');
|
10
|
-
const
|
10
|
+
const db_all = thunkify(db.all.bind(db));
|
11
11
|
|
12
|
-
const friends = yield
|
12
|
+
const friends = yield db_all("SELECT * FROM friend");
|
13
|
-
const messages= yield
|
13
|
+
const messages= yield db_all("SELECT * FROM message");
|
14
14
|
|
15
15
|
for(const friend of friends){
|
16
16
|
const body = messages['phase'][friend['phase']];
|