]> granicus.if.org Git - pdns/commitdiff
Add search records/comments to gSQLite3
authorAki Tuomi <cmouse@cmouse.fi>
Wed, 5 Aug 2015 16:22:07 +0000 (19:22 +0300)
committerAki Tuomi <cmouse@cmouse.fi>
Wed, 5 Aug 2015 19:25:53 +0000 (22:25 +0300)
modules/gsqlite3backend/gsqlite3backend.cc

index b99888cda439ab7f132b3c0b9c7a8edfc9d1e2da..670031e5f6f63995d74a76f44c30b0cdbeb41ffe 100644 (file)
@@ -134,6 +134,9 @@ public:
     declare(suffix, "insert-comment-query", "", "INSERT INTO comments (domain_id, name, type, modified_at, account, comment) VALUES (%d, '%s', '%s', %d, '%s', '%s')");
     declare(suffix, "delete-comment-rrset-query", "", "DELETE FROM comments WHERE domain_id=%d AND name='%s' AND type='%s'");
     declare(suffix, "delete-comments-query", "", "DELETE FROM comments WHERE domain_id=%d");
+
+    declare(suffix, "search-records-query", "", record_query+" name LIKE '%s' OR content LIKE '%s' LIMIT %d");
+    declare(suffix, "search-comments-query", "", "SELECT domain_id,name,type,modified_at,account,comment FROM comments WHERE name LIKE '%s' OR comment LIKE '%s' LIMIT %d");
   }
 
   //! Constructs a new gSQLite3Backend object.