Skip to content
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

Support multiple databases & schemas? #3

Open
bgentry opened this issue May 8, 2024 · 1 comment
Open

Support multiple databases & schemas? #3

bgentry opened this issue May 8, 2024 · 1 comment

Comments

@bgentry
Copy link
Contributor

bgentry commented May 8, 2024

A user asked for our UI to be capable of letting a single UI instance serve multiple databases so they don't require a single UI deployment per database. I've run into the frustration of having to have many different UI deployments at my day job, so I agree this would be nice.

We might also be able to tackle multiple schemas using the same mechanism here. Imagine if the UI is able to somehow take a config of DB names to URLs. There could be a switcher in the menu bar to allow you to change the "context" of which one you're working on.

The big question I have is how this would be reflected in URLs for either the frontend or the API backend. Does the DB name become a required part of the path or a query param in either case? On the frontend, you could keep it as a local storage setting (like switching from light to dark mode) and keep it out of the URL, but this would have some downsides (URLs not as easily shareable between users). Instead of that, we may want to structure our URLs to include the DB name as a prefix.

cc @brandur

@brandur
Copy link
Collaborator

brandur commented May 8, 2024

Yeah good question. IMO we should really try get everything in the URL as nicely as possible because it's going to be so much more convenient for things like bookmarks or sending links to people.

One possibility is that when having the user configure the UI, we ask them to name each database URL they want to use like:

{
    "prod": "postgres://.../prod",
    "staging": "postgres://.../staging"
}

We'd encourage the names to be URL friendly and they could go in the URL's path.

Schemas should be in there too. They might be easier in that what we could do is maybe not put anything in the path if it's the default schema, but otherwise include them, and since they're just a simple name like my_schema, they're inherently more friendly for inclusion in a path already.

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

No branches or pull requests

2 participants