Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
DBCore (dbcore.org)
223 points by omarfarooq on Nov 8, 2021 | hide | past | favorite | 28 comments


Unexpected to see this here! I have not done a lot of work on this recently, but happy to answer any questions if you have any.


Came across it on an old comment where you said you were building something similar to Supabase. ;)


Looks a lot like PostgREST, but with more backends (not just postgres), fewer fancy features (joins? not mentioned here), and with the client-side code generator built in (typescript).

If the author is reading, assuming I'm using Postgres and typescript, in what situations would I choose this over PostgREST + any openapi code generator?


The difference between this and openapi code generator (I think) is that I made a few specific decisions in the builtin templates that help get internal business apps off the ground faster. But since it's designed around a template system you could do whatever you want with it. And of course openapi is much more mature just generally speaking.

It's different from PostgREST in that it doesn't dynamically read schemas from the DB during the application server runtime. You generate an application from the DB up front and then you can do whatever you want with that generated application afterward.


How to migrate to a backwards-incompatible version of the schema without data loss?


This project has no state so to migrate your db you'd turn off the generated app, migrate the db, regenerate the app, and turn it back on.


When I used a similar-ish library, the answer was mostly: don't make backwards-incompatible versions of the schema


Are there any UI-generators that can go with postgrest?

Dbcore looks so great, but i cant really stomach adding another language (Go..) to the mix.


I haven't used any of them, but PostgREST lists a bunch of client libs in a variety of languages in their docs. [0]

If you're worried about another language in the mix, you should know that PostgREST is powered by Haskell.

[0] https://postgrest.org/en/v8.0/ecosystem.html#client-side-lib...


You can try https://dadabik.com (disclaimer: I am the author/founder).


Interesting how many languages are in here, HTML/CSS/TS on the front-end is no surprise, Go on the generated back-end is a little less expected than full-stack Typescript. The fact that the tool itself is in F# is really interesting. I kind of expected it to be some combinations of the others.

This is really cool. Poking around the source code, it's surprisingly simple. It's just a database -> template engine with a front-end/back-end template included.


It is not surprising it is that simple. It really is that simple to generate CRUD templates. People just don’t do it.


I’ve been wanting to build this for years! Especially in a B2B setting, sometimes they simply want a prototype.


I would love if something like this existed except it used a .proto as the source of truth and had a way to provide ways to rename/query certain fields.

Would make it easy to replace shared DBs with APIs over time.


Real world CRUD is a bit different though, you want to send the log to somewhere else, use Sentry to try catch error in your CRUD endpoint. Or publishing a message to Kafka after u created an object. How to integrate "real world components" into this ?


The primary use case I had in mind for this was internal business apps.

But a few ways you could hook without any code changes in dbcore: use LISTEN/NOTIFY or equivalent to hook on changes, poll for changes in the DB, "eject" the generated code and edit API handlers directly to call where you want, or just edit the default templates directly with whatever API handlers you want to call.

It's true there's not a great way to add hooks at a configuration level at the moment. But there are still many ways you could work around that.


Lot of these internal business apps have a attached workflow to CRUD (reviews, approval etc)

Any thoughts around workflows?


Not really in line with this particular CRUD subject, but combine-able esp. if things grow in size and scale: https://temporal.io provides a really nice way to code your workflows in Golang, applicable for small-scale, while hiding most complexity that come with scaling.


aye, i work at Temporal, happy to answer any qtns!


2021, let me introduce you to Microsoft Access, but now for the web


care to tell us what specific similarities you see between MS Access and this? I worked with Access and it had a few issues, it could be buggy and it did not support multiple users nor logins or sso.


I didn't meant to disparage the project. The comparison is because it does in the web basically the same thing that access provided: the ability for power users to build applications with minimal or absolutely no code given a physical data model.


It's more like Oracle APEX.


I have used Oracle APEX and I assure you this is pretty dissimilar to APEX. :)


Remember when DB's embedded web servers so you could access their data over HTTP? That was like 2000 right? The world has come full circle.


We access the DB manually -> this is difficult and repetitive -> The DB does is -> This is inflexible and difficult -> We access the DB manually


I like these kind of tools. I wish there were more thing like this in the .NET ecosystem


There is, I made something similar for my needs.

Docs could be better, but it's a open source and free I did in my free ti lme without sponsors or any money.

https://github.com/vb-consulting/PgRoutiner




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: