trilium/src/entities/note.js

21 lines
442 B
JavaScript
Raw Normal View History

2018-01-29 12:16:50 +08:00
"use strict";
class Note {
constructor(sql, row) {
this.sql = sql;
for (const key in row) {
this[key] = row[key];
}
}
async attributes() {
return this.sql.getRows("SELECT * FROM attributes WHERE noteId = ?", [this.noteId]);
}
async revisions() {
return this.sql.getRows("SELECT * FROM note_revisions WHERE noteId = ?", [this.noteId]);
2018-01-29 12:16:50 +08:00
}
}
module.exports = Note;