-
Notifications
You must be signed in to change notification settings - Fork 224
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
Comments
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;
With all the code, categories, roles, relationships, schemas, functions, triggers, etc., it becomes difficult to spot optimization errors or relationships, search for features, etc. Especially when working alone. I am currently working with a group of social workers, aiming to map the multiple dimensions of a social group, family, and the individual situation of each member. The goal is to create new studies and projects that help improve the quality of life for people in vulnerable situations with limited resources and members with disabilities. |
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). |
I think CSV upload is only meant to have you upload tabular data and postgres.new will create a database schema from it. |
Okay, I kept trying different options to see if I could achieve what I needed. The first attempt was to ask Mr. Postrgre (that's what I affectionately call it) if it accepted Markdown notation, to which it responded yes. Then I created a function with However, when I used the prompt 'create all those tables and their relationships', it threw an error because the order of the tables was not correct (without relationships first and then the ones with relationships).
The second attempt involved ordering the function to display tables without relationships first. However, I forgot that some tables are purely relationships themselves, and an error message appeared. So, until the ban is lifted, I won’t be able to contribute further to the cause. Next time, I'll try adding another level of ordering to the function. For example:
Therefore, the provincia table should be created before the localidad table, and the localidad table should be created before the barrios table. I hope this information helps others to know 'how not to do it,' which is just as important, if not more so, than 'how to do it right.' |
Okay, the ban is gone, and I tested it with this It ran perfectly, returned the table as expected, I copied it as Markdown, and Mr. Postgre ran the code without any issues or problems. So i promt; 'Create all the tables and relations' (then paste de MarkDown in the same prompt)
Obviously, it will all depend on the number of tables and columns within them, as I don't know how many characters can be included in a single prompt.
|
Mr. Postgre image looks like: "...You better wait, wait a minute (Wait, wait a minute, Mr. Postgre) The marvelettes: Please Mr postman |
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.
The text was updated successfully, but these errors were encountered: