TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: DbDeclare – A Python declarative layer for your database

3 pointsby falafeliteabout 2 years ago
Hi HN! I made and just published v0.0.1 of DbDeclare. I use Python a lot, and interact with Postgres a lot. I like using SQLAlchemy, and I love Alembic. Those wonderful tools primarily operate on tables, though, and I often find myself writing custom code to declare what databases, roles, schemas, privileges, etc. I want, and I have a hard time updating them reliably and in a repeatable fashion.<p>That&#x27;s where DbDeclare aims to help: declare what you want in your cluster (in addition to SQLAlchemy-defined tables and columns) in-code, alongside your tables. There is a lot this can&#x27;t do yet (thus the v0.0.1), but I think there&#x27;s a decent foundation here to build on and eventually have really nice features like autogenerating change statements between your in-code definition and what is actually in your database cluster (like Alembic).<p>This is also my first attempt at building an open-source project, so I&#x27;m sure there are plenty of mistakes. Please feel free to provide feedback, I&#x27;d love to make it better.<p>For what it&#x27;s worth, I&#x27;m aware that you can do some of this at the infrastructure-as-code layer using a tool like Terraform&#x2F;Pulumi. My personal preference is to have all this sit closer to my tables rather than my infrastructure, so here we are.<p>Anyway, let me know what y&#x27;all think. Thanks!

no comments

no comments