Description
Hi,
I have recently started looking into atlas, and it looks pretty cool - it really seems like finally proper DevOps practices are coming to the DB world. This has been long overdue!
I have a feature proposal for you, which I think might be an interesting way to 'close the loop' and allow atlas to become an 'all you need' setup.
Atlas right now concerns itself with the database side of things - write sql, define tables, databases, apply migration, check migrations are safe, etc.
There is not much linking it to actual programming languages. There is a section about integrating ORMs into the setup, but ORMs often require a different level of abstraction (often leaky) and they're not for everyone. They are also relatively heavyweight and not trivial to integrate.
What would be cool is partnering with https://sqlc.dev/ or doing something like they are doing. You already inspect and understand the schema - it should be doable to have an option to emit type definitions in several programming languages. So if you have a Table {user, id} in your database, you can auto-generate tables like
@dataclass.dataclass
class Table:
user: string | None
id: string
or something like this - same for typescript, go, and the most common languages. [0]
Not only tables - you could also do the same for queries. SQL queries are saved somewhere to disk, and you can analyse them and spit out functions which call those queries, annotating them with the appropriate input & output types computed from the db schema.
This also allows you to have better CI - as part of the CI step, you can test the sql queries saved to ensure they would work fine with the new schema before applying it - which is something that currently it's not done, right?
You have a more holistic view of the usage of the database, it allows better integration tests, and using the generated types, it allows for seamless integration into many programming languages.
Let me know what you think - this is probably not a trivial effort, but I was just curious to see if this is something that's on your radar at all. At least for me, it would become an amazing DevX, requiring essentially no other tool to fully manage a database.
[0] Alternatively, you can also support a language-independent format like protobuf - which would then be compiled to typescript, python bindings, etc. This would also have the advantage of being able to use the same protobuf object across services talking to the db.
Activity