-
-
Notifications
You must be signed in to change notification settings - Fork 25
add support for new naming scheme username@package
#155
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
The |
create or replace function dbdev.install( | ||
package_name text, | ||
base_url text default 'https://api.database.dev/rest/v1/', | ||
api_key text default 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InhtdXB0cHBsZnZpaWZyYndtbXR2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2ODAxMDczNzIsImV4cCI6MTk5NTY4MzM3Mn0.z2CN0mvO2No8wSi46Gw59DFGCTJrzM0AQKsu_5k134s' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not for this PR, but we do need to figure out how to deploy clients without baking in the anon key.
Sorry to chime in here, but when you say packages can be installed using the old way if they existed prior, does that mean that basejump_core would always be installed as basejump-basejump_core, or would it just always work as both? It's only important because you can't change the installed package name without data loss as far as I know, so just creates a split flow for new/old users of an extension. |
It would work as both for now but the old naming scheme is soft-deprecated by e.g. only showing the new scheme on
If by data loss you mean that the extension needs to be reinstalled then this is true but I don't see a way around Postgres treating the two naming schemes as different extensions. So even though the following two will install the exact same extension in terms of the functionality, they are different extensions as far as Postgres is concerned:
Since dbdev is still not |
Yeah, understand the thinking on your end, just wondering about the words "soft deprecated" and "for now" and what those mean longer term. I ask because basejump is used in my own projects as well, and if it won't be supported with the current install path I'll need to figure out a way to both migrate my own projects to the new format as well as any users. Since it installs tables/functions used for auth/billing, would just be important for me to find a way to do it smoothly. Do you intend on maintaining the old install path indefinitely or should I figure it out sooner than later? |
We intend to keep only the new naming scheme in the long term, so it's better if you could upgrade sooner rather than later. Would something like the following work for you for upgrading without downtime to the extension with the new naming scheme?: -- start a transaction
begin;
-- drop extension with old naming scheme
drop extension "basejump-basejump_core";
-- uninstall extension with old naming scheme
select pgtle.uninstall_extension('basejump-basejump_core');
-- install extension with new naming scheme
select dbdev.install('basejump@basejump_core');
-- create extension with new naming scheme
create extension "basejump@basejump_core";
-- commit the transaction
commit; |
I'll give it a shot, but I'm pretty sure that'll result in all the tables created by basejump-basejump_core being deleted and then identical empty tables being created by basejump@basejump_core. Will play around with options now that I know it's deprecating. Thanks for the quick responses. |
You are right, data in objects created by a TLE will need to be migrated manually. |
What kind of change does this PR introduce?
feature
What is the current behavior?
Packages are named
username-package
, e.g.kiwicopple-pg_idkit
.What is the new behavior?
Packages will be named
user@package
, e.g.kiwicopple@pg_idkit
. Packages published after this change is rolled out can only be installed with new names. Packages published before can still be installed with older naming scheme for compatibility with older dbdev clients. dbdev clients older than 0.0.5 will not be able to install old packages with the new naming scheme. dbdev 0.0.5 (added in this PR) can install all packages with the new naming scheme.Additional context
N/A