]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Build the query configuration at runtime. 16115/head
authorMiod Vallat <miod.vallat@powerdns.com>
Fri, 12 Sep 2025 07:49:27 +0000 (09:49 +0200)
committerMiod Vallat <miod.vallat@powerdns.com>
Fri, 12 Sep 2025 08:11:46 +0000 (10:11 +0200)
Fixes: #4033
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
regression-tests/backends/godbc_sqlite3-master

index aef648d120050cb2abf98285dae9a16a080742cd..1f609b36edb1989d3fe78af344b183b652e51f67 100644 (file)
@@ -11,67 +11,8 @@ module-dir=$PDNS_BUILD_PATH/modules
 launch=godbc
 godbc-datasource=$GODBC_SQLITE3_DSN
 
-# ../pdns/pdns_server --module-dir=./modules/ --launch=gsqlite3 --config | grep gsqlite3 | grep query | grep = | cut -c3- | perl -pe 's/^gsqlite3/godbc/; s/:\w+/?/g'
-godbc-activate-domain-key-query=update cryptokeys set active=1 where domain_id=(select id from domains where name=?) and  cryptokeys.id=?
-godbc-add-domain-key-query=insert into cryptokeys (domain_id, flags, active, published, content) select id, ?, ?, ?, ? from domains where name=?
-godbc-any-id-query=SELECT content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE disabled=0 and name=? and domain_id=?
-godbc-any-query=SELECT content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE disabled=0 and name=?
-godbc-basic-query=SELECT content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE disabled=0 and type=? and name=?
-godbc-clear-domain-all-keys-query=delete from cryptokeys where domain_id=(select id from domains where name=?)
-godbc-clear-domain-all-metadata-query=delete from domainmetadata where domain_id=(select id from domains where name=?)
-godbc-clear-domain-metadata-query=delete from domainmetadata where domain_id=(select id from domains where name=?) and domainmetadata.kind=?
-godbc-deactivate-domain-key-query=update cryptokeys set active=0 where domain_id=(select id from domains where name=?) and  cryptokeys.id=?
-godbc-delete-comment-rrset-query=DELETE FROM comments WHERE domain_id=? AND name=? AND type=?
-godbc-delete-comments-query=DELETE FROM comments WHERE domain_id=?
-godbc-delete-domain-query=delete from domains where name=?
-godbc-delete-empty-non-terminal-query=delete from records where domain_id=? and name=? and type is null
-godbc-delete-names-query=delete from records where domain_id=? and name=?
-godbc-delete-rrset-query=delete from records where domain_id=? and name=? and type=?
-godbc-delete-tsig-key-query=delete from tsigkeys where name=?
-godbc-delete-zone-query=delete from records where domain_id=?
-godbc-get-all-domain-metadata-query=select kind,content from domains, domainmetadata where domainmetadata.domain_id=domains.id and name=?
-godbc-get-all-domains-query=select domains.id, domains.name, records.content, domains.type, domains.master, domains.notified_serial, domains.last_check, domains.account, domains.catalog from domains LEFT JOIN records ON records.domain_id=domains.id AND records.type='SOA' AND records.name=domains.name WHERE records.disabled=0 OR ?
-godbc-get-domain-metadata-query=select content from domains, domainmetadata where domainmetadata.domain_id=domains.id and name=? and domainmetadata.kind=?
-godbc-get-last-inserted-key-id-query=select last_insert_rowid()
-godbc-get-order-after-query=select min(ordername) from records where disabled=0 and ordername > ? and domain_id=? and ordername is not null
-godbc-get-order-before-query=select ordername, name from records where disabled=0 and ordername <= ? and domain_id=? and ordername is not null order by 1 desc limit 1
-godbc-get-order-first-query=select ordername from records where disabled=0 and domain_id=? and ordername is not null order by 1 asc limit 1
-godbc-get-order-last-query=select ordername, name from records where disabled=0 and ordername != '' and domain_id=? and ordername is not null order by 1 desc limit 1
-godbc-get-tsig-key-query=select algorithm, secret from tsigkeys where name=?
-godbc-get-tsig-keys-query=select name,algorithm, secret from tsigkeys
-godbc-publish-domain-key-query=update cryptokeys set published=1 where domain_id=(select id from domains where name=?) and  cryptokeys.id=?
-godbc-id-query=SELECT content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE disabled=0 and type=? and name=? and domain_id=?
-godbc-info-all-primary-query=select domains.id, domains.name, domains.type, domains.notified_serial, domains.options, domains.catalog, records.content from records join domains on records.domain_id=domains.id and records.name=domains.name where records.type='SOA' and records.disabled=0 and domains.type in ('MASTER', 'PRODUCER') order by domains.id
-godbc-info-all-secondaries-query=select domains.id, domains.name, domains.type, domains.master, domains.last_check, records.content from domains LEFT JOIN records ON records.domain_id=domains.id AND records.type='SOA' AND records.name=domains.name where domains.type in ('SLAVE', 'CONSUMER')
-godbc-info-zone-query=select id,name,master,last_check,notified_serial,type,options,catalog,account from domains where name=?
-godbc-info-producer-members-query=select domains.id, domains.name, domains.options from records join domains on records.domain_id=domains.id and records.name=domains.name where domains.type='MASTER' and domains.catalog=? and records.type='SOA' and records.disabled=0
-godbc-info-consumer-members-query=select id, name, options, master from domains where type='SLAVE' and catalog=?
-godbc-insert-comment-query=INSERT INTO comments (domain_id, name, type, modified_at, account, comment) VALUES (?, ?, ?, ?, ?, ?)
-godbc-insert-empty-non-terminal-order-query=insert into records (type,domain_id,disabled,name,ordername,auth,ttl,prio,content) values (null,?,0,?,?,?,null,null,null)
-godbc-insert-record-query=insert into records (content,ttl,prio,type,domain_id,disabled,name,ordername,auth) values (?,?,?,?,?,?,?,?,?)
-godbc-insert-zone-query=insert into domains (type,name,master,account,last_check,notified_serial) values(?, ?, ?, ?, null, null)
-godbc-list-comments-query=SELECT domain_id,name,type,modified_at,account,comment FROM comments WHERE domain_id=?
-godbc-list-domain-keys-query=select cryptokeys.id, flags, active, published, content from domains, cryptokeys where cryptokeys.domain_id=domains.id and name=?
-godbc-list-query=SELECT content,ttl,prio,type,domain_id,disabled,name,auth,ordername FROM records WHERE (disabled=0 OR ?) and domain_id=? order by name, type
-godbc-list-subzone-query=SELECT content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE disabled=0 and (name=? OR name like ?) and domain_id=?
-godbc-nullify-ordername-and-update-auth-query=update records set ordername=NULL,auth=? where domain_id=? and name=? and disabled=0
-godbc-nullify-ordername-and-update-auth-type-query=update records set ordername=NULL,auth=? where domain_id=? and name=? and type=? and disabled=0
-godbc-remove-domain-key-query=delete from cryptokeys where domain_id=(select id from domains where name=?) and cryptokeys.id=?
-godbc-remove-empty-non-terminals-from-zone-query=delete from records where domain_id=? and type is null
-godbc-search-comments-query=SELECT domain_id,name,type,modified_at,account,comment FROM comments WHERE name LIKE ? OR comment LIKE ? LIMIT ?
-godbc-search-records-query=SELECT content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE name LIKE ? OR content LIKE ? LIMIT ?
-godbc-set-domain-metadata-query=insert into domainmetadata (domain_id, kind, content) select id, ?, ? from domains where name=?
-godbc-set-tsig-key-query=replace into tsigkeys (name,algorithm,secret) values(?,?,?)
-godbc-autoprimary-query=select account from supermasters where ip=? and nameserver=?
-godbc-unpublish-domain-key-query=update cryptokeys set published=0 where domain_id=(select id from domains where name=?) and  cryptokeys.id=?
-godbc-update-account-query=update domains set account=? where name=?
-godbc-update-kind-query=update domains set type=? where name=?
-godbc-update-lastcheck-query=update domains set last_check=? where id=?
-godbc-update-primary-query=update domains set master=? where name=?
-godbc-update-ordername-and-auth-query=update records set ordername=?,auth=? where domain_id=? and name=? and disabled=0
-godbc-update-ordername-and-auth-type-query=update records set ordername=?,auth=? where domain_id=? and name=? and type=? and disabled=0
-godbc-update-serial-query=update domains set notified_serial=? where id=?
 __EOF__
+               ${PDNSSERVER:-../pdns/pdns_server} --module-dir=./modules/ --launch=gsqlite3 --config | grep query= | perl -pe 's/^# gsqlite3/godbc/; s/:\w+/?/g' >> pdns-godbc_sqlite3.conf
 
                gsql_master godbc_sqlite3 nodyndns
                ;;