dataform icon indicating copy to clipboard operation
dataform copied to clipboard

Support setting pre and post operations via config blocks

Open lewish opened this issue 5 years ago • 1 comments

For SQLX files.

When applying the same pre/post operations to many files, it's cleaner to be able to use JavaScript for advanced uses cases, e.g. when applying the same grant operations across many tables. Currently you can only set pre/post operations using the SQLX syntax.

It should be possible to also add pre/post operations via the config block. For example:

config {
  ...
  postOperations: [someInclude.commonGrantStatement]
}

All pre and post operations inside the config block should probably go before any defined inside SQLX to give a sensible ordering.

lewish avatar Aug 13 '20 10:08 lewish

I think this needs a little further thought, I would like a design doc before we implement this.

Initial thoughts: (1) The ordering constraint is a bit of a pain, do we need it? We never needed it before, why now? (2) IMO if you specify this, it should be invalid to also have a pre_operations block (3) Would like to review this syntax more generally.

BenBirt avatar Aug 16 '20 17:08 BenBirt

We haven't had much interest in the issue and SQLX v2 could make this obsolete - so closing

Ekrekr avatar Feb 10 '23 17:02 Ekrekr