Replies: 1 comment 1 reply
-
The general idea seems interesting; however, I find the rationale weak for several reasons:
Providing a clear example of a simple model extension could reinforce this concept and help people better understand its key benefits and realise drawbacks. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Writing this while traveling in the back of a car to run the Khao Yai marathon this weekend!
This is a Request For Discussion on the extension layout approach that I've recently developed (and hoping to speak about at some of the conferences this year).
As we know, extension harnessing has some properties that can be seen as deficiencies:
It has occurred to me at some point that there could be a solution to all this in one package. The core of the idea was that maybe the effects of extensions should be provisioned into the installing user's ownership, in the schema of their choosing?
And if we can specify the schema the extension should be installed into, perhaps we can also specify other parameters?
Taking an analogy from C++ templates (please bear with me, I don't mean this in a bad way 😃 ) I thought what if extension simply provided a template instantiation function that provisions everything that extension needs, with all the parameters (optional and non-optional) being function parameters?
Here's an example: https://github.com/omnigres/omnigres/blob/master/extensions/omni_credentials/src/instantiate.sql#L1-L2
The function then creates database objects it needs and puts them into the designated schema.
Turns out this seems to work pretty well:
Upgrades of these instantiations can be performed by newer versions of the extension by analyzing whatever information is stored in the instantiation – the shape of it, the metadata.
There are some interesting aspects like finding a set of shared patterns to be able to list all instantiated templated extensions. I am working on these, but one of the simplest ways is to create tables or functions with a certain naming and/or shape that act as providers of such information. Happy to elaborate here as I am going deeper on this concept (I've already started making new Omnigres extensions templated)
And yes, technically this means that extensions as we know them become mere envelopes of templates and can be shipped by other means (other than .control/.sql)
What do you think? Do you see any holes?
Beta Was this translation helpful? Give feedback.
All reactions