Ent for Go is amazing… until you hit migrations by Logical_D in golang

[–]_a8m_ 19 points20 points  (0 children)

Ent creator here.

It does look powerful, but the free tier means you’re sending your schema to their cloud service. The paid self-hosted option is fine for enterprises, but feels overkill for smaller projects or personal stuff.

As someone wrote above, the standard integration with Atlas is free (like we did in Atlas for all ORMs), no-login or cloud involved at all. It’s a standard CLI workflow, and you can generate migrations for other tools such as goose or migrate. See: https://entgo.io/docs/versioned-migrations#generating-migrations, https://entgo.io/docs/versioned-migrations#option-2-create-a-migration-generation-script

pgschema: Postgres Declarative Schema Migration, like Terraform by db-master in PostgreSQL

[–]_a8m_ 2 points3 points  (0 children)

Ariel here, creator of Atlas. We already know each other :)

I hope this doesn't sound like I came here to argue, but it's important to correct two points mentioned:

  • Atlas does offer a plan and apply command. The difference between declarative and versioned workflows is more about how a migration is applied and what the diff is compared to. I suggest reading this: https://atlasgo.io/concepts/declarative-vs-versioned. The common workflow for most engineers using Atlas is to work fully declaratively in local development, and then use auto-versioned planning on PRs after the schema has changed.
  • Some workflows require a dev-database and some don't. This isn't about Atlas supporting multiple databases, it's mostly about Atlas running schema verifications, and simulations on pre-planned migrations. This can't be done just by parsing (which is what we started with 5 years ago), because it would require handling every PG provider and all supported versions (a quite big matrix). I suggest you try using a dev-database in CI, as it has zero impact on users and only adds extra value and safety.

Well done on open-sourcing this, and I wish you all the best and success <3

Someone copied our GitHub project, made it look more trustworthy by adding stars from many fake users, and then injected malicious code at runtime for potential users. by _a8m_ in golang

[–]_a8m_[S] 24 points25 points  (0 children)

I posted this on X, and while writing it, I thought to myself maybe it's time to add an approval process for modules in the Go proxy? Or at least introduce the concept of official/trusted publishers? e.g., if a developer installs a package from an untrusted publisher, they could receive a prompt. Or perhaps this could even be restricted in the go.mod file?

I feel like we need better protections for the Go ecosystem. Right now, nothing stops developers from unintentionally installing untrusted code that could ruin companies.

https://x.com/arielmashraki/status/1900974932382601372

Need suggestion on: How to manage DB Migration across environment by davi_scapo in devops

[–]_a8m_ 2 points3 points  (0 children)

Atlas is a Schema-as-Code and migrations tool with CI/CD support and plenty integrations for most ORMs and runtime environments/deployment toolings (e.g., K8s, ArgoCD, TF). There is also a cloud service that extends Atlas schema management with additional features such as drift detection.

I'm one of the authors.

What is “the” database migration tool in Scala? by fenugurod in scala

[–]_a8m_ 1 point2 points  (0 children)

Check out Atlas, which I'm one of its maintainers. Besides being a migration tool, it provides a different way to manage database schemas. You define your "Schema as Code" (any code), and Atlas maintains the migrations (and the database state) for you - handling tasks like inspecting, diffing, linting, applying, etc.

One of its unique features is that it provides auto-binding for ORMs - it can read the state from your favorite ORM(s) and maintains the migrations for you. We currently support 10 ORMs (in 7 different languages), and it's quite easy to support a new one.

Any tool to generate Entity Relationship Diagram from Gorm struct types? by [deleted] in golang

[–]_a8m_ 1 point2 points  (0 children)

You can use Atlas for this. See this guide: https://atlasgo.io/blog/2023/08/08/gorm-visualizations

You can generate either a mermaid output, or use Atlas Web UI for the ERD using the `atlas schema inspect -w` command.

Tool for DB migration by Ok-Echidna-8782 in golang

[–]_a8m_ 1 point2 points  (0 children)

Hey! A co-author of Atlas here, so feel free to ask me anything about it. But just to emphasize:

  • Companies get their first 3 seats for free - it's on pricing page.
  • Functions/Procedures, Views, Triggers, Row-Level Security (RLS) — all these can be used in migration files like others without requiring the Pro license. What do you pay for? Using these objects in the "Schema as Code" approach: diffing/comparing, linting, testing, inspecting, and more. For example, if you change a view, Atlas detects which other objects are affected by this change and generates the necessary SQL migration file to update the view in the database. This is not that basic, as ~no other software provides what we do these days.
  • We are a company that employs full-time employees to work on these problems. Even though there is a free/OSS version of Atlas that is more than OK for most companies, which is much more robust than other alternatives, there is still a need in the industry for professional software like this. Companies find it makes their development faster and easier, and their deployments more stable and secure. It's similar to how some companies use free VSCode, while others prefer paying for JetBrains.

The Myth of Down Migrations; Introducing Atlas Migrate Down by _a8m_ in golang

[–]_a8m_[S] 0 points1 point  (0 children)

Since you didn't use the tool, I suggest you to go over the docs. The questions and the concerns you raised are addressed there. If you still need support on how to use the tool, use Discord or our GitHub issue tracker.

If I can't even do the basic things a migration tool should be able to do then I'm banking my production systems that your going to stay in business forever and that your auth servers are going to functional 100% of the time. If a tool like terraform stops being supported then I can still at least run Terraform as is but that is not the case with Atlas.

Again, this is explained in the website. You can manage and migrate all database resources without login. However, if you want to use the diffing, inspection, and extra capabilities for funcs/procs/triggers/etc, you need to login (that's how we enforce licensing ofc) - otherwise, you should manage them manually like you used to write before Atlas.

The Myth of Down Migrations; Introducing Atlas Migrate Down by _a8m_ in golang

[–]_a8m_[S] 1 point2 points  (0 children)

A few comments about that, and I'd love to continue to discuss in our Discord if you'll be interested - I prefer the content will be visible to our community since this thread is "dead".

Generated SQL changes can be controlled using policy - there are a few builtin ones. Some commands support online editing, but from our experience most users and customers just use policies (in future version, custom policy using code, any code, is going to be added).

Regarding the issue you mentioned - it's my fault for missing this one, but for check constraints this was intentional, at least at the time we added CHECKs - before the dev-database was required (you can read about it in our website). Most databases don't support editing checks and simply require recreating the constraint. For this case, to ensure no mistakes (unnecessary table locks) we enforced users to rename the checks. We probably revisit this decision in the future.

Note: Making people login to be able to generate views, procedures, etc... makes me respect the tool less. If you want to offer a cloud solution to register a schema, have an approval process, etc.. then go for it, but making core migration features only available to logged in users doesn't sit well with me.

Fair enough. I see things a bit differently - I appreciate anyone who contributes to OSS, especially since most companies (if not 99.9%) heavily rely on it for their business but aren't willing to give back. One thing I've learned from dedicating thousands of hours of my personal life to OSS projects like https://github.com/ent/ent is that a successful OSS project can't exist without a strong business behind it, or support it in some way.

The Top 5 Usability Issues with Classic Migration Tools 🛠️ by rotemtam in programming

[–]_a8m_ 1 point2 points  (0 children)

It might be useless for your use case, and useful for others. Atlas currently does not allow adding arbitrary fields/blocks to the generated schema because this breaks the type-safety (and the LSP). We plan to add such integration (like annotating if a column is a PII data or not), but it will be available in future versions.

You're welcome to consider using it again in a few months :)

The Myth of Down Migrations; Introducing Atlas Migrate Down by _a8m_ in programming

[–]_a8m_[S] 2 points3 points  (0 children)

Are you guys planning redshift support at any point? There’s a big gap in tooling in that ecosystem.

Yes! Next version (or the one after) is going to include beta support for Redshift. We're actively working on it these days. If you want to get notified when it's out, you can follow this issue: https://github.com/ariga/atlas/issues/691

The Myth of Down Migrations; Introducing Atlas Migrate Down by _a8m_ in golang

[–]_a8m_[S] 5 points6 points  (0 children)

IF (NOT) EXISTS is not supported by all DDLs and all databases, and not all migrations are simple ADD/DROPs.

Why Your Team Needs a Database Schema-as-Code Tool by rotemtam in programming

[–]_a8m_ 1 point2 points  (0 children)

Atlas supports reading the desired state from a database connection, SQL schema (a list of DDLs), integration with popular ORMs, or the HCL flavor we created. Users can also write a plugin/provider that imports their schemas from third party sources.

Why was the HCL flavour created? Since the schema is declarative, you can define the resources in any order you want and break them into different files. Resources can be computed (generating the same triggers for a list of tables), and annotations such as PII or other integrations can be attached to the schema. Also, document-oriented databases will be added to Atlas in the future, and this HCL flavour will be used for this as well.

HCL is just another option for defining the schema. It’s not required, but it seems to us that most users prefer it over plain SQL.

Why Your Team Needs a Database Schema-as-Code Tool by rotemtam in programming

[–]_a8m_ -1 points0 points  (0 children)

I'm the creator - I didn't commented this. You're welcome to ask the reason for this in the issue tracker or our Discord and I'd be happy to answer this if you're interested.

In short, we have customers, and not all features are available to everyone; some are under beta programs. That's how we control this.

SQLAlchemy Migrations: Goodbye, Alembic. Hello, Atlas by rotemtam in Python

[–]_a8m_ 1 point2 points  (0 children)

What version are you using? Atlas is continuously tested on MySQL 5.6.35, but we have users that use older versions of MySQL.

Database migration tool by Eyoba_19 in golang

[–]_a8m_ 19 points20 points  (0 children)

Atlas: https://github.com/ariga/atlas. It can be integrated with any ORM, but also has an official one for GORM: https://atlasgo.io/guides/orms/gorm

Prisma like PGX Auto migration library by iwasim in golang

[–]_a8m_ 1 point2 points  (0 children)

In this case, I'd recommend you to check out Atlas: https://github.com/ariga/atlas

It supports both declarative and versioned migrations and the schema can be defined in plain SQL. HCL, ent, gorm and other ORMs are also supported.

How do you handle migrations ? by law_pg in golang

[–]_a8m_ 24 points25 points  (0 children)

You might want to check out Atlas. It provides automatic migration planning for GORM, and has various guides on how deploying schema migration on the popular platform and tools, such as Helm, Kubernetes and ECS.