Execute the 'restrictionTemplate' code for all databases
Goal
The current functionality of preparing a "restricted" user assumes that we are working with a single database ("Default database name" in DLE config), and this is explicitly stated in the configuration.
...
global:
engine: postgres
debug: true
database:
username: postgres
dbname: test
...
As a result of which the "restrictionTemplate
" code was executed only in the "global.database.dbname
" database and not in all databases. And command alter database
is executed only for a single database, not for all databases.
This is not entirely obvious in cases where we have multiple logical databases.
TODO / How to implement
Change the const restrictionTemplate
so that this code is executed for all databases in the postgres instance
In a loop for each database from this query:
select datname
from pg_catalog.pg_database
where not datistemplate
Acceptance criteria
- code in the
const restrictionTemplate
is executed for all databases
Edited by Vitaliy Kukharik