Currently the system requires the following syntax:
GRANT template X'123123' TO X'456456';
The following would be a bit more user-friendly (but may interfere with parameter binding?):
GRANT template (INSERT INTO foo VALUES ($invoker, ?a, ?b)) TO X'456456';
This interferes with parameter binding as ?a is intended as a parameter for the template, but needs to be bound in the GRANT statement (or we should ignore them here). Another solution would be to use string literals:
GRANT template 'INSERT INTO foo VALUES ($invoker, ?a, ?b);' TO X'456456';
This may lead to issues with escaping.
A better solution would be to support calculating a template hash using a macro, e.g. the front-end query looks like GRANT template (INSERT INTO foo VALUES ($invoker, ?a, ?b)) TO X'456456'; for which the actual on-chain query becomes GRANT template X'123123' TO X'456456';.
Currently the system requires the following syntax:
The following would be a bit more user-friendly (but may interfere with parameter binding?):
This interferes with parameter binding as ?a is intended as a parameter for the template, but needs to be bound in the GRANT statement (or we should ignore them here). Another solution would be to use string literals:
This may lead to issues with escaping.
A better solution would be to support calculating a template hash using a macro, e.g. the front-end query looks like
GRANT template (INSERT INTO foo VALUES ($invoker, ?a, ?b)) TO X'456456';
for which the actual on-chain query becomesGRANT template X'123123' TO X'456456';
.