-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
package as a TLE #2
Comments
Great idea! I'll start looking into that. Thanks |
@kiwicopple I'm starting to look into this and have run into a couple questions:
|
yes
The user can specify a new schema to install into so that there are no clashes, using the command
this is no longer necessary. Postgres now has the
it's now public :) |
btw, you can see a "minimum viable extension" here: https://github.com/kiwicopple/pg-extensions/tree/main/is_odd |
@kiwicopple When a new version of a TLE is released, what happens to existing deployments? Do tables persist? Are they recreated? What if there is a breaking change to the table schema that the new version depends on? Although the minimum viable extension was somewhat helpful, I think a "getting started creating a TLE" guide with best practices would also be great. I may even be able to help write this once I understand more about how this works. Just trying to get caught up right now and there are very few docs about the development side, only consumption of TLEs. Edit: I just found the publishing guide: https://supabase.github.io/dbdev Edit 2: The publishing guide answered my questions above. Disregard please. Thanks! Edit 3: New question, how do I test this locally before publishing? Obviously I can just run the sql file but is that the same as "creating" or "updating" an "extension"? Edit 4: How do I update the readme without updating the SQL? If I increment the control version number, will it require me to also have a correlated sql file ending with that version? How does a user upgrade a TLE? Do they just run the installation command again? (SQL would normally reject installation of an existing object) Would it have to have a version specified in that case? |
At the moment I just use supabase locally: https://github.com/kiwicopple/pg-extensions/tree/main/supabase I think we should do some better tooling for this over time
you can't - you need to bump the version. I'll start documenting everything that you've asked here in dbdev docs |
Thanks! So for bumping the version just for a readme update - would I just leave that version's sql file blank since there are no functional changes? |
you would copy/paste the SQL from your old file to the new file eg: |
Ah okay, so it doesn't work like a migration where all get run in order during installation. So when a user installs a specific version, it only runs the file for that version? Does that mean that when authoring upgrades, I need to account for both previous as well as new first-time installs? If I were to change table schema in v2, I can't just assume it exists from v1 but have to check first, yeah? I appreciate your patience and willingness to help me understand all the intricacies of this. I just want to make sure I don't upload a tle that is broken and can't be removed or fixed. I also want to release the most stable updates possible. Thanks for your time Edit: Please let me know if you need any further modifications for this in order to include it in the upcoming launch week. |
@point-source I hope your questions are answered in the discussion in supabase/dbdev#164. |
@imor, yep, thanks to you. Closing now. |
would you like to package this up so that it can be used in dbdev (https://databases.dev)?
then it can be installed like:
context: https://supabase.com/blog/dbdev
The text was updated successfully, but these errors were encountered: