supabase / dbdev Goto Github PK
View Code? Open in Web Editor NEWDatabase Package Registry for Postgres
Home Page: https://database.dev/
License: Apache License 2.0
Database Package Registry for Postgres
Home Page: https://database.dev/
License: Apache License 2.0
Currently the public.packages
view is defined like this:
create or replace view public.packages as
select
pa.id,
pa.package_name,
pa.handle,
pa.partial_name,
newest_ver.version as latest_version,
newest_ver.description_md,
pa.control_description,
pa.control_requires,
pa.created_at,
pa.default_version
from
app.packages pa,
lateral (
select *
from app.package_versions pv
where pv.package_id = pa.id
order by pv.version_struct desc
limit 1
) newest_ver;
Notice how in the lateral clause only app.package_versions
are read but there's no app.package_upgrades
. This results in the latest version being returned as less if there is one base version with an upgrade.
To reproduce publish an extension with my_ext--1.0.0.sql
and my_ext--1.0.0--2.0.0.sql
files and notice how the latest version reported is 1.0.0
.
To fix, the view should take the maximum version from among the app.package_versions
's version
column and app.package_upgrade
's to_version
column.
I have 2 files for my extension.
basejump_core--2.0.1.sql
basejump_core--2.0.1--2.1.0.sql
Default version set to 2.1.0.
On a clean install, running create extension "basejump_core" version '2.1.0';
will fail with the following error:
ERROR: could not find sql function "basejump_core--2.1.0.sql" for extension basejump_core in schema pgtle
Based on the pg_tle docs, this appears like it should work by first installing 2.0.1 and then following the 2.1.0 path - but doesn't seem to.
Here's a PR with the upgrade I'm working on which doesn't work: usebasejump/basejump#57
I expect the extension to be installable to 2.1.0 without having a dedicated basejump_core--2.1.0.sql
extension file
Unable to see the repository information (and/or source code) for the pglet.
All package managers generally have them on the package page.
Expect to see repository information.
Currently we don't link to the author documentation
this task is for adding references to the author documentation prominently in the main repo README.md + on the database.dev website homepage.
When in dark mode, text in table cells has extremely low contrast.
Text should not have extremely low contrast. 🙂
I am unable to apply a local migration.
ERROR: extension "supabase-dbdev" is not available (SQLSTATE 0A000)
Steps to reproduce the behavior, please provide code snippets or a repository:
supabase db pull
supabase db reset
Migration applied, incl extension.
I tried to run all the install commands locally first (from here) but this did not help.
Migration file example:
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
CREATE EXTENSION IF NOT EXISTS "pg_tle" WITH SCHEMA "pgtle";
CREATE EXTENSION IF NOT EXISTS "supabase-dbdev" WITH SCHEMA "public";
CREATE EXTENSION IF NOT EXISTS "pgsodium" WITH SCHEMA "pgsodium";
CREATE SCHEMA IF NOT EXISTS "supabase_migrations";
ALTER SCHEMA "supabase_migrations" OWNER TO "postgres";
CREATE EXTENSION IF NOT EXISTS "http" WITH SCHEMA "extensions";
CREATE EXTENSION IF NOT EXISTS "pg_graphql" WITH SCHEMA "graphql";
CREATE EXTENSION IF NOT EXISTS "pg_stat_statements" WITH SCHEMA "extensions";
CREATE EXTENSION IF NOT EXISTS "pgcrypto" WITH SCHEMA "extensions";
CREATE EXTENSION IF NOT EXISTS "pgjwt" WITH SCHEMA "extensions";
CREATE EXTENSION IF NOT EXISTS "pointsource-supabase_rbac" WITH SCHEMA "public";
CREATE EXTENSION IF NOT EXISTS "supabase_vault" WITH SCHEMA "vault";
CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA "extensions";
What is the way to move from remote to local, incl the extensions?
We don't currently have dependency resolution in dbdev.
Currently, authors might specify requires
in their control file to depend on other dbdev TLEs expecting that to work. It would be nice if we could detect and reject those projects on upload with a useful error message.
In the future, if we implement dependency resolutions, we can loosen that restriction.
Note: we still want to allow authors to define dependencies against native extensions (pgvector, hypopg, etc)
create dbdev ls
command to list available and installed TLEs
Included in output
Not really a bug, but don't think documentation tag either.
Once a TLE is published can I remove it?
I did a test TLE that is useless but can't find a way to remove it.
I understand that could be an issue if people have installed and may be why it does not exist.
Just want to confirm I'm not missing something.
dbdev deoesn't support all of gh flavored markdown:
https://database.dev/kiwicopple/supa_audit
from this extension:
The current code to parse .control
files in the models.rs
is primitive. Use a parser that matches the logic in the GUC parser in postgres.
N/A
this page only describes the steps to install
Improve documentation by explaining the difference with pgxn.
Page which needs improvement: README.md
.
When I hear npm for pg, I immediately think about pgxn. I think It'd be useful to explain how these tools differ, what different use case they help with.
From my perspective, pgxn seems oriented towards extensions, while dbdev is more about regular piece of sql? Pgxn ships source code and gives an easy way to compile them. You'd need a shell access to the machine, and probably be superuser. Dbdev seems to be usable by user with less privilege?
When calling dbdev publish
on an already-published package, I get a success message:
Published package uuidv7 upgrade from 1.0.1 to 1.0.2
I have previously done the same with an upgrade from 1.0.0 to 1.0.1, which was just a readme change. But the package version on database.dev is still 1.0.0.
What I did, and I'm not going to reproduce it myself as I don't want to spam the server with broken test packages, especially since I can't delete them afterward:
dbdev publish
.dbdev publish
again.dbdev publish
again. There's a success message.dbdev publish
again, get a success message, nothing happens.When I get the message Published package uuidv7 upgrade from 1.0.1 to 1.0.2
, I expect database.dev to list that version.
The current version of my control file:
# uuidv7 extension
comment = 'UUIDv7 extension'
default_version = '1.0.2'
relocatable = false
superuser = false
We don't currently display the home repository of a package so users of the package can suggest improvements/open PRs/issues etc
Task is to add a field for it and display it on the website
Currently password reset mail are sent from @mail.app.supabase.io domain. Change this so that emails are sent from database.dev
domain.
Profile pages for non-existent users is shown.
Steps to reproduce the behavior, please provide code snippets or a repository:
https://database.dev/cat
. cat
can be replaced with any non-existent user.cat
.An error about user not existing should be displayed.
N/A
psql:_install.sql:43: ERROR: invalid extension name: "supabase@dbdev"
DETAIL: Extension names must only contain alphanumeric characters or valid separators.
Just try to run the long bootstrap script in the Readme on a new db.
It not to fail.
psql:_install.sql:43: ERROR: invalid extension name: "supabase@dbdev"
DETAIL: Extension names must only contain alphanumeric characters or valid separators.
Add any other context about the problem here.
I would like to install a TLE into my project, but I'm wondering about the maintainability and did not find any information about how the TLE should provide update.
It would be great to have a section about how to handle version migrations as a package maintainer as well as a user.
For sure dbdev is not responsible for the content of the packages, but providing guidelines would encourage adoption.
After a user signs up they are redirected to the sign-in page, but this is not needed as the user is already logged in. So, the user should be either redirected to the home page or whichever page they were on before the sign-up page.
Steps to reproduce the behavior, please provide code snippets or a repository:
The user can be taken directly to the home page after they sign-up.
N/A
N/A
N/A
Currently the default_version
from control files is not tracked
We recommend that users always specify a version number when enabling an extension but this argument should be added to the top level package table and updated on dbdev publish
because it has an impact on pg_dump/pg_restore projects.
Note, there are 3 components to this:
default_version
in the databaseI accidentally pushed a package without a readme:
https://database.dev/kiwicopple/countries
I wanted to update just the readme, so I edited the file on my computer then ran dbdev publish --path .
I got this back: Nothing to publish
This makes sense, but it could be nice to have a way to update the readme without needing to bump the version (i don't know if NPM allows this though)
Installing the author CLI currently requires a local rust toolchain.
This task is for publishing (at minimum) brew installable releases
linux + windows can wait until after LW if they're problematic since installing from source is always an option but would be great to include if its a light lift
Running dbdev install
locally to test the plugin will correctly install one version of the extension correctly, but fail if there is a second version available. removing all but one version works as expected. I thought it might be aws/pg_tle#186, but that appears to be included in the version of pg_tle shipped with supabase already.
This might be user error, but I'm unable to find a path around it.
Steps to reproduce the behavior, please provide code snippets or a repository:
SELECT pgtle.uninstall_extension_if_exists('supabase_test_helpers');
SELECT * FROM pgtle.available_extension_versions();
dbdev install --connection postgresql://postgres:postgres@localhost:54322/postgres --path .
Here's my current PR with the changes: usebasejump/supabase-test-helpers#13
I'd expect both 0.0.1 and 0.0.2 to be correctly installed through pg_tle. It appears to be installing 0.0.2 correctly and then failing on 0.0.1 saying it already exists
The FAQ page (https://database.dev/faq) shows the profile page (AFAIK, I was just taking a look at the site, I'm not a user) of a user named faq (created today, presumably now()
is a default value?)
The confirmation email link redirects to http://localhost:3000
Confirmation email link redirects to https://database.dev
I do not see a page which addresses or explains how TLE updates are supposed to be written and applied
As a developer, I cannot figure out how to safely write a new version:
As a user, I cannot tell how to upgrade a TLE or what to expect when I do. For example:
I would like extensive documentation and examples of how devs are expecting to write and provide TLE updates. I would also like a list of best practices, warnings, errors, and dangers that could result from not following the guidelines. Overall this system currently feels opaque and risky for both devs and users.
I was asked if I could provide my package as a TLE, which I did but I am now unsure how to update it. I asked a while ago but didn't get a response and now my users are asking me. I also have an update I'd like to push. This also overlaps the user-focused issue here.
Running the install script for dbdev locally via npx supabase db reset
results in an error.
Resetting database...
Initialising schema...
Applying migration 00000000000000_setup_test_environment.sql...
Error: ERROR: extension "pg_tle" is not available (SQLSTATE 0A000)
At statement 2: create extension if not exists pg_tle
Try rerunning the command with --debug to troubleshoot the error.
ELIFECYCLE Command failed with exit code 1.
Create a migration using the install script and run the db reset to initialise the DB.
It appears to work fine in the hosted version when doing npx supabase db push
, but running it locally doesn't work for some reason.
The types, links and texts when creating a new issue in this repo is for supabase product and not database.dev. They need to be fixed.
the current doc only describes how to do it using SQL
example:
dbdev install --connection postgres://postgres:postgres@localhost:54322/postgres --path ./pg_idkit
(This one is up for debate but I think it would be useful especially for testing environments like GH actions)
The "dbdev install" command adds the TLE to the database but doesn't "enable" the extension. It could be useful to have a command like dbdev create pg_idkit --connection " which essentially runs:
CREATE EXTENSION pg_idkit;
Add any other context or screenshots that help clarify the task.
In review by design team
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.