Atlas – A Database Toolkit
github.com
Atlas – A Database Toolkit
1–10 of 14 posts
Re: Atlas – A Database Toolkit
#2It's terraform, but for database.
- It allows defining SQL database schema in HCL (terraform's DSL) for now.
- It can inspect a database and create the HCL for it.
- It can do database migrations similar to terraform. You define the new schema in HCL, and it allegedly takes care of producing the SQL needed to perform the migration. It also has a "plan" step like Terraform.
---
I hope I didn't missunderstand or missed something.
Re: Atlas – A Database Toolkit
#3Going through the readme and the homepage still left me asking "What exactly does it do?". Going through the readme, their home page, and this blog post ( https://blog.ariga.io/meet-atlas-cli/ ), here's a tldr; It's terraform, but for database. - It allows defining SQL database schema in HCL (terraform's DSL) for now. - It can inspect a database and create the HCL for it. - It can do database migrations similar to te…
You describe the existing state well. Atlas can currently be used to perform what we call declarative database migrations.
This is great for many use cases. But it will not do for others, for a few reasons .
First, there are many ways to get from point A to point B. The classic example is a table rename. To get from the existing to the desired state, we can either ALTER TABLE or DROP and CREATE it. What did the user mean? Second, migrations are a very sensitive operation that can easily result in an outage if done wrong. Therefore, many companies check each migration into source control and have it reviewed in CR, and perform different quality and safety assessments on it.
Therefore, while “terraform for DBs” sounds great, it’s not enough. In the next versions of Atlas, we’re rolling out a different workflow that we call migration authoring or “versioned migrations” that address these issues in a very cool way that I hope many will view as useful.
Happy to answer any questions! R
Re: Atlas – A Database Toolkit
#4Primary additional feature I wish it had is support for manual migrations in addition to declarative hcl. So it would be great if I could have a unified changelog or migration list where some of the migrations were autogenerated from the diff in hcl and others were manually written (for things the hcl doesn't current support like procs and triggers) and I could rollback them together if needed.
I also wrote a simple code-generator[1] for typescript & zod to prevent having to duplicate the row types between atlas and ts, which others may find useful. It's still pretty early stage though.
Re: Atlas – A Database Toolkit
#5Atlas is quite nice. I recently started using it in a typescript/node.js project (which was using liquibase before) and I find the DX to be great. Primary additional feature I wish it had is support for manual migrations in addition to declarative hcl. So it would be great if I could have a unified changelog or migration list where some of the migrations were autogenerated from the diff in hcl and others were manuall…
HCL?
Edit: Found it. “HashiCorp Configuration Language, a computer configuration language, used by Terraform.” It’s surprisingly hard to Google for.
Re: Atlas – A Database Toolkit
#6Atlas is quite nice. I recently started using it in a typescript/node.js project (which was using liquibase before) and I find the DX to be great. Primary additional feature I wish it had is support for manual migrations in addition to declarative hcl. So it would be great if I could have a unified changelog or migration list where some of the migrations were autogenerated from the diff in hcl and others were manuall…
declarative hcl HCL? Edit: Found it. “HashiCorp Configuration Language, a computer configuration language, used by Terraform.” It’s surprisingly hard to Google for.
Re: Atlas – A Database Toolkit
#7Atlas is quite nice. I recently started using it in a typescript/node.js project (which was using liquibase before) and I find the DX to be great. Primary additional feature I wish it had is support for manual migrations in addition to declarative hcl. So it would be great if I could have a unified changelog or migration list where some of the migrations were autogenerated from the diff in hcl and others were manuall…
I am working on versioned migrations right now and you can expect the first release in the near future.
We will allow users to specify a migration directory where Atlas will create migration files you can edit manually. We want to support existing well working tools like golang-migrate or Flyway as well, where you can easily add your own migrations files.
If you have any further question, I am happy to answer them! M
Re: Atlas – A Database Toolkit
#8Atlas is quite nice. I recently started using it in a typescript/node.js project (which was using liquibase before) and I find the DX to be great. Primary additional feature I wish it had is support for manual migrations in addition to declarative hcl. So it would be great if I could have a unified changelog or migration list where some of the migrations were autogenerated from the diff in hcl and others were manuall…
Hey lf-non, I am working on versioned migrations right now and you can expect the first release in the near future. We will allow users to specify a migration directory where Atlas will create migration files you can edit manually. We want to support existing well working tools like golang-migrate or Flyway as well, where you can easily add your own migrations files. If you have any further question, I am happy to an…
Re: Atlas – A Database Toolkit
#9Re: Atlas – A Database Toolkit
#10Not to be confused with MongoDB Atlas!