")\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, " \
} 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);