"select * from cols\n" \
"order by path;"
-#define SQL_NOTEBOOK_GET_NOTES "select n.*, r.resource_id as [__resources__resource_id], r.parent_id, r.nodename, r.displayname, r.lastmodified, r.creationdate, r.iscollection, r.contenttype from resources r inner join notes n on r.resource_id = n.resource_id where parent_id = ? ;"
+#define SQL_NOTEBOOK_GET_NOTES \
+ "select n.*, r.resource_id as [__resources__resource_id], r.parent_id, " \
+ "r.nodename, r.displayname, r.lastmodified, r.creationdate, r.iscollection, r.contenttype " \
+ "from resources r inner join notes n on r.resource_id = n.resource_id where parent_id = ? ;"
#define SQL_NOTE_GET_CONTENT "select content from resources where resource_id = ? ;"
-#define SQL_NOTE_RESOURCE_NEW "insert into resources(parent_id, nodename, displayname, lastmodified, creationdate, content) values (?, ?, ?, unixepoch(), unixepoch(), ?) returning resource_id;"
+#define SQL_NOTE_RESOURCE_NEW \
+ "insert into resources(parent_id, nodename, displayname, lastmodified, creationdate, content) values " \
+ "(?, ?, ?, unixepoch(), unixepoch(), ?) returning resource_id;"
#define SQL_NOTE_NEW "insert into notes(resource_id, type) values (?, ?) returning note_id;"
#define SQL_NOTE_DELETE "delete from resources where resource_id = ? ;"
-#define SQL_ATTACHMENT_RESOURCE_NEW "insert into resources(parent_id, nodename, lastmodified, creationdate, content) values ((select parent_id from resources where resource_id = ?), ?, unixepoch(), unixepoch(), ?) returning resource_id;"
-#define SQL_ATTACHMENT_NEW "insert into attachments(attachment_resource_id, parent_resource_id, type) values (?, ?, ?) returning attachment_id;"
+#define SQL_ATTACHMENT_RESOURCE_NEW \
+ "insert into resources(parent_id, nodename, lastmodified, creationdate, content) values " \
+ "((select parent_id from resources where resource_id = ?), ?, unixepoch(), unixepoch(), ?) returning resource_id;"
+
+#define SQL_ATTACHMENT_NEW \
+ "insert into attachments(attachment_resource_id, parent_resource_id, type) values " \
+ "(?, ?, ?) returning attachment_id;"
#define SQL_ATTACHMENTS_GET "select attachment_id, attachment_resource_id, parent_resource_id, a.type, "\
"r.nodename, r.displayname, r.content from attachments a "\
"inner join resources r on a.attachment_resource_id = r.resource_id " \
"where parent_resource_id = ? order by attachment_id;"
-#define SQL_NOTEBOOK_NEW "insert into resources(parent_id, nodename, iscollection) values (?, ?, 1) returning resource_id;"
+#define SQL_NOTEBOOK_NEW \
+ "insert into resources(parent_id, nodename, iscollection) values " \
+ "(?, ?, 1) returning resource_id;"
static DBUConnection *connection;