-- The instance's data table role catalog: one row per Postgres login Windmill created for data -- table access. -- -- A table rather than a `global_settings` key, because the value is a set of live cluster -- credentials and that table has generic read, list, write and CLI round-trip paths that know -- nothing about what they are carrying. Every one of them is a way to leak the passwords or to -- overwrite the catalog with a copy that has none, and a row nothing generic touches has none of -- those. One row per role also makes two concurrent creates two inserts rather than a -- read-modify-write over one document. CREATE TABLE datatable_role ( id VARCHAR(50) PRIMARY KEY, -- The Postgres role name, verbatim. Unique because it is the cluster's own key. name VARCHAR(63) NOT NULL UNIQUE, enabled BOOLEAN NOT NULL DEFAULT true, -- Generated by Windmill, never entered by anyone, and never leaves the server. pwd TEXT, created_at TIMESTAMPTZ NOT NULL DEFAULT now() ); GRANT ALL ON datatable_role TO windmill_user; GRANT ALL ON datatable_role TO windmill_admin;