]> uap-core.de Git - note.git/commitdiff
order noteobooks by position
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Mon, 2 Jun 2025 17:07:02 +0000 (19:07 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Mon, 2 Jun 2025 17:07:02 +0000 (19:07 +0200)
application/store.c

index 6f2f231ee0fd4cfdfd0150d16668dcd95a76eb3c..c70071a9019ece6715a870f7ba853195caad0ae4 100644 (file)
@@ -55,7 +55,7 @@
     ")\n" \
     "select n.*, r.resource_id as [__resources__resource_id], r.* from cols r\n" \
     "left join notebooks n on r.resource_id = n.resource_id\n" \
-    "order by path;"
+    "order by depth, position;"
 
 #define SQL_NOTEBOOK_GET_NOTES \
     "select n.*, r.resource_id as [__resources__resource_id], r.parent_id, " \
@@ -799,6 +799,8 @@ typedef struct CreateNotebookJob {
 } CreateNotebookJob;
 
 static int qthr_new_notebook(CreateNotebookJob *job) {
+    // TODO: maybe use transactions
+    
     DBUQuery *q = connection->createQuery(connection, NULL);
     dbuQuerySetSQL(q, SQL_NOTEBOOK_RES_NEW);
     dbuQuerySetParamInt64(q, 1, job->resource->parent_id);