| | 63 | |
| | 64 | // and now with auth |
| | 65 | declare(suffix,"basic-query-auth","Basic query","select content,ttl,prio,type,domain_id,name, case when auth then 1 else 0 end as auth from records where type='%s' and name='%s'"); |
| | 66 | declare(suffix,"id-query-auth","Basic with ID query","select content,ttl,prio,type,domain_id,name, case when auth then 1 else 0 end as auth from records where type='%s' and name='%s' and domain_id=%d"); |
| | 67 | declare(suffix,"wildcard-query-auth","Wildcard query","select content,ttl,prio,type,domain_id,name, case when auth then 1 else 0 end as auth from records where type='%s' and name like '%s'"); |
| | 68 | declare(suffix,"wildcard-id-query-auth","Wildcard with ID query","select content,ttl,prio,type,domain_id,name, case when auth true then 1 else 0 end as auth from records where type='%s' and name like '%s' and domain_id='%d'"); |
| | 69 | |
| | 70 | declare(suffix,"any-query-auth","Any query","select content,ttl,prio,type,domain_id,name, case when auth then 1 else 0 end as auth from records where name='%s'"); |
| | 71 | declare(suffix,"any-id-query-auth","Any with ID query","select content,ttl,prio,type,domain_id,name, case when auth then 1 else 0 end as auth from records where name='%s' and domain_id=%d"); |
| | 72 | declare(suffix,"wildcard-any-query-auth","Wildcard ANY query","select content,ttl,prio,type,domain_id,name, case when auth then 1 else 0 end as auth from records where name like '%s'"); |
| | 73 | declare(suffix,"wildcard-any-id-query-auth","Wildcard ANY with ID query","select content,ttl,prio,type,domain_id,name, case when auth then 1 else 0 end as auth from records where name like '%s' and domain_id='%d'"); |
| | 74 | |
| | 75 | declare(suffix,"list-query-auth","AXFR query", "select content,ttl,prio,type,domain_id,name, case when auth then 1 else 0 end as auth from records where domain_id='%d'"); |
| | 76 | |
| | 77 | |
| | 78 | |
| 71 | 85 | declare(suffix,"insert-slave-query","", "insert into domains (type,name,master,account) values('SLAVE','%s','%s','%s')"); |
| 72 | 86 | declare(suffix,"insert-record-query","", "insert into records (content,ttl,prio,type,domain_id,name) values ('%s',%d,%d,'%s',%d,'%s')"); |
| | 87 | |
| | 88 | declare(suffix,"get-order-before-query","DNSSEC Ordering Query, before", "select ordername, name from records where ordername <= '%s' and auth and domain_id=%d order by 1 desc limit 1"); |
| | 89 | declare(suffix,"get-order-after-query","DNSSEC Ordering Query, afer", "select min(ordername) from records where ordername > '%s' and auth and domain_id=%d"); |
| | 90 | declare(suffix,"set-order-and-auth-query", "DNSSEC set ordering query", "update records set ordername='%s',auth=(%d = 1) where name='%s' and domain_id='%d'"); |
| | 91 | |
| | 92 | |
| 79 | | declare(suffix,"add-domain-key-query","", "insert into cryptokeys (domain_id, flags, active, content) select id, %d, %d, '%s' from domains where name='%s'"); |
| 80 | | declare(suffix,"list-domain-keys-query","", "select cryptokeys.id, flags, active, content from domains, cryptokeys where domain_id=domains.id and name='%s'"); |
| | 99 | declare(suffix,"add-domain-key-query","", "insert into cryptokeys (domain_id, flags, active, content) select id, %d, (%d = 1), '%s' from domains where name='%s'"); |
| | 100 | declare(suffix,"list-domain-keys-query","", "select cryptokeys.id, flags, case when active then 1 else 0 end as active, content from domains, cryptokeys where domain_id=domains.id and name='%s'"); |
| 81 | 101 | declare(suffix,"get-domain-metadata-query","", "select content from domains, domainmetadata where domain_id=domains.id and name='%s' and domainmetadata.kind='%s'"); |
| 82 | 102 | declare(suffix,"clear-domain-metadata-query","", "delete from domainmetadata where domain_id=(select id from domains where name='%s') and domainmetadata.kind='%s'"); |
| 83 | 103 | declare(suffix,"set-domain-metadata-query","", "insert into domainmetadata (domain_id, kind, content) select id, '%s', '%s' from domains where name='%s'"); |
| 84 | | declare(suffix,"activate-domain-key-query","", "update cryptokeys set active=1 where domain_id=(select id from domains where name='%s') and cryptokeys.id=%d"); |
| 85 | | declare(suffix,"deactivate-domain-key-query","", "update cryptokeys set active=0 where domain_id=(select id from domains where name='%s') and cryptokeys.id=%d"); |
| | 104 | declare(suffix,"activate-domain-key-query","", "update cryptokeys set active=true where domain_id=(select id from domains where name='%s') and cryptokeys.id=%d"); |
| | 105 | declare(suffix,"deactivate-domain-key-query","", "update cryptokeys set active=false where domain_id=(select id from domains where name='%s') and cryptokeys.id=%d"); |