Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Create graphback db command #47

Closed
ankitjena opened this issue Jun 13, 2019 · 8 comments
Closed

Create graphback db command #47

ankitjena opened this issue Jun 13, 2019 · 8 comments
Assignees
Labels

Comments

@ankitjena
Copy link
Collaborator

ankitjena commented Jun 13, 2019

About

graphback db will create Postgres database with tables and relations from the model

@ankitjena ankitjena added this to To do in GraphBack 1.0.0 Jun 13, 2019
@ankitjena ankitjena added the cli label Jun 14, 2019
@ankitjena
Copy link
Collaborator Author

@wtrocki your views?

@ankitjena ankitjena self-assigned this Jun 15, 2019
@ankitjena ankitjena moved this from To do to In progress in GraphBack 1.0.0 Jun 15, 2019
@wtrocki
Copy link
Contributor

wtrocki commented Jun 15, 2019

in my opinion we should first ask if someone wants to have just DDL files or major changes directly on the database. secondly we should not support dropping or removing the data only additions should be added for obvious reasons. the major problem is how to maintain this data base connection. we can say that for production we recommend DDL statements and direct db generation for local development

@wtrocki
Copy link
Contributor

wtrocki commented Jun 15, 2019

having hard dependency to postgress is not desired. I think we first need to implement cli config and then do this task

@ankitjena
Copy link
Collaborator Author

in my opinion we should first ask if someone wants to have just DDL files or major changes directly on the database. secondly we should not support dropping or removing the data only additions should be added for obvious reasons. the major problem is how to maintain this data base connection. we can say that for production we recommend DDL statements and direct db generation for local development

Since production might always be at later stages than development, we can do both and store the DDL statements in a file?

@wtrocki
Copy link
Contributor

wtrocki commented Jun 16, 2019

How this is going to work?
Are we going to support only initial database creation? How about cases when building new app for existing database?

@ankitjena
Copy link
Collaborator Author

ankitjena commented Jun 17, 2019

We could create a database with the name of the project, that way it won't affect existing database in case of building new app.
But a thing to care for is if a user edits the model, then table creation will be skipped if it's already been created or deletes a Type then the table would exist in the database

@wtrocki
Copy link
Contributor

wtrocki commented Jun 17, 2019

We could create a database with the name of the project, that way it won't affect existing database in case of building new app.

You mean on localhost or some remote server?

But a thing to care for is if a user edits the model, then table creation will be skipped if it's already been created or deletes a Type then the table would exist in the database

Hm.. this will render the entire feature not functional. If user edits model we need to update the database simply because it will no be possible to query data.

Let's talk about how this could work in general. Like I totally do not see it now.

If we have diffs locally for the development database then those diffs will work only for this particular database, which can be in a different state than any other database. We cannot avoid diffing the current dataset and applying changes.

Because probably pointing tool to any other database than local one is not that realistic scenario we can assume that people will have tags for their work so then they can use local db state (actually the previous state to calculate diff changes)

This part is critical for the success of the project so we need to really make sure that we are on the same page. Maybe we can quickly build a sequence diagram showing how this could work from trying this out to the finish. What happens when user adds new type, adds new field/directive etc.

We could end up in very complex workflow quickly so let's think on something that will work and this will set the boundaries on what problems we going to resolve and how users can really interact with the CLI for the success of the project.

@ankitjena ankitjena moved this from In progress to Done in GraphBack 1.0.0 Jun 24, 2019
@ankitjena
Copy link
Collaborator Author

Closing this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
Development

No branches or pull requests

2 participants