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
Description of migrations is missing #17
Comments
I think explaining terms such as "migrations" are a bit out of scope for SafeQL since I'm not trying to teach developers about SQL but rather give them a DX solution. I believe the Configuration page should be as practical as possible. Although, I won't mind if there was a brief explanation (a sentence or two) about the topic with a follow-up to an FAQ page. |
Ok, I just meant a single sentence about this, but I understand if you don't want to include this information.
Totally agree! But the Configuration page should definitely have a description about what each thing does. Currently it is unexplained and undocumented - and as an experienced developer I still don't understand what this feature is, even after you wrote to me on Twitter about it 😬 |
I see. Documentation was never my strong side. I'll try to be as descriptive as possible here, and maybe we can find a way to make it clearer in the docs: I support two ways of analyzing the queries. Either by supplying a database URL or by migrations folder. When you supply a database URL, the plugin does the following actions:
Now the fun part - migrations:Schema migrations are a way of managing your database changes chronologically. Like Git, it helps track down how the database was built. It's the source of truth of your database declaration. How to run migrations?Migration can have one or more statements (ALTER, CREATE, etc.). We run migrations like how we run queries. Why it matters when using SafeQL?Since we can't query against migration files (since they are only a set of instructions rather than an actual database), we need to create a database (we'll call it a shadow database) based on a set of instructions written in the migrations. Once we have a database, we can do what's written in the steps above. To create a database, we have to connect to Postgres. To connect to Postgres, we have to connect to an existing database. Which database will always exist? |
Nice, lots of detail there! I think this is definitely enough. Also, this is what I assumed that SafeQL was doing from what I could gather, so that's good too. |
Thanks! I guess 2 things are still open for me here:
|
Hey, About 1 - Feel free to submit a PR or open a new issue for it |
Ok I'll open a PR for both of these - documenting that only |
Open at #49 |
Describe the bug
On the Configuration page of the docs, the "2. A basic example of migrations folder" section is missing a description of what migrations are, both:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Migrations are explained
Screenshots
--
Desktop (please complete the following information):
Additional context
--
The text was updated successfully, but these errors were encountered: