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

Import an existing schema #51

Open
jmporchet opened this issue Aug 12, 2024 · 7 comments
Open

Import an existing schema #51

jmporchet opened this issue Aug 12, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@jmporchet
Copy link

Feature request

Is your feature request related to a problem? Please describe.

I would like to load an existing schema into the tool in order to work on it

Describe the solution you'd like

Upload a sql file that contains the schema of my database

Describe alternatives you've considered

the LLM suggests using the importCsv and exportCsv methods, but the csv uplaod functionality is to create a new database

Additional context

I would love to be able to talk about advanced use cases like pg functions, triggers, vectors etc.

@jmporchet jmporchet added the enhancement New feature or request label Aug 12, 2024
@amerryma
Copy link

So, what I'm hoping to do is actually embed postgres-new into my development workflow. I want it to be able to look at my current supabase schema for whatever branch I have checked out. I then want to be able to iterate on a new feature quickly within a local running copy of postgres-new. Then when I'm satisfied with the schema, I want to just export the "diff" as a migration and commit the change. This is why it would be important for me to be able to load an existing schema (and even test data).

@jmporchet
Copy link
Author

ok, when i export on supabase as csv using:

SELECT 
    table_schema,
    table_name,
    column_name,
    ordinal_position AS position,
    data_type,
    is_nullable,
    column_default
FROM 
    information_schema.columns
WHERE 
    table_schema = 'public'
ORDER BY 
    table_name, ordinal_position;
* Say that is an excel file (and is not an xls or xlsm, etc)

I think CSV upload is only meant to have you upload tabular data and postgres.new will create a database schema from it.
It's not clear enough from the UI or from the docs IMHO....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants
@jmporchet @amerryma and others