Skip to content

Conversation

@divyenduz
Copy link
Owner

@divyenduz divyenduz commented May 7, 2023

Fix #23

Demo:

plv8ify-pg_tle.mp4

@divyenduz
Copy link
Owner Author

divyenduz commented May 7, 2023

@samwillis Thanks for suggesting this feature in #23, if you get a moment, please give me a review on this one. This implements the first version of pg_tle mode.

For now, it removes and updates the same extension name/version instead of using the versions concept from pg_tle. I will probably merge this as is to already start playing around with pg_tle + https://database.dev and slowly build APIs for better usage of versioning API. Not doing that right now because need to clean up the code a bit + add a bunch of tests etc.

What do you think?

P.S. I made a deploy feature via #19, this PR adds pg_tle mode to it.

@divyenduz divyenduz marked this pull request as ready for review May 7, 2023 13:01
}
}
await match(CLI.config.deployMode)
.with('functions', async () => {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added two modes, 'functions' mode gets the existing code that was there.

}
)
})
.with('pg_tle', async () => {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added two modes, 'pg_tle' mode gets the new code that instead of executing each individual SQL function file, collects them as a single string and executes SELECT pgtle.install_extension with appropriate parameters on it.

@samwillis
Copy link
Contributor

Look awesome @divyenduz!

The deploy command is really good for working on extensions for internal use.

My main thought is that the combining the "building" of the tle extension with the deploy command (if I understand correctly) limits the ability to further distribute the extension. It would be good if there was a way to build the tle extension as a single .sql that can be distributed, either via database.dev or any other means.

I was imagining maybe --mode tle, or --mode bundle --package-as-tle (which gives flexibility of build modes)

Superbase are working on a command line tool to enable uploading extensions to database.dev, and so having a way to build, then call that (when they finish it) to upload it would be perfect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a pg_tle mode

2 participants