fix(sqlite): wrong db query

pull/10050/head
Andelf 2023-08-16 14:54:51 +08:00
parent c90050aee9
commit eb4476c0b6
5 changed files with 11 additions and 8 deletions

View File

@ -203,7 +203,7 @@ const SQLiteDB = {
await this.newDB(dbName);
db = dbMap[dbName];
}
const sql = sqlite3.str_new(db, "SELECT uuid, page_uuid FROM blocks");
const sql = sqlite3.str_new(db, "SELECT uuid, page_uuid FROM blocks WHERE type = 1");
const prepared = await sqlite3.prepare_v2(db, sqlite3.str_value(sql));
const rows = [];
while (await sqlite3.step(prepared.stmt) === SQLite.SQLITE_ROW) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -141,12 +141,17 @@
block? (boolean block-id)
block (get-block page-name)
block-unloaded? (state/sub-block-unloaded? repo (:block/uuid block))]
(prn ::page page-name block-id block? block page-e
(:block/_parent block))
(cond
block-unloaded?
(ui/loading "Loading...")
(and (not block?)
(empty? (:block/_parent block)))
(and
(not block?)
(empty? (:block/_parent block))
)
(dummy-block page-name)
:else

View File

@ -41,6 +41,4 @@
([repo exclude-uuids]
(<fetch-blocks-excluding repo exclude-uuids {}))
([repo exclude-uuids opts]
(p/let [ret (protocol/<fetch-blocks-excluding (get-impl) repo exclude-uuids opts)]
(js/console.log "fetch-by-exclude" ret)
ret)))
(protocol/<fetch-blocks-excluding (get-impl) repo exclude-uuids opts)))