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

index d3c1866084c5c4df7cf568872c4d2931e19c7af8..1d1e3af14063107fe19f64b67892de9d033f3e15 100644 (file)
@@ -118,6 +118,9 @@ public:
     declare(suffix, "insert-comment-query", "", "INSERT INTO comments (domain_id, name, type, modified_at, account, comment) VALUES (%d, E'%s', E'%s', %d, E'%s', E'%s')");
     declare(suffix, "delete-comment-rrset-query", "", "DELETE FROM comments WHERE domain_id=%d AND name=E'%s' AND type=E'%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");
   }
 
   DNSBackend *make(const string &suffix="")