Generating a full-stack application from a database(notes.eatonphil.com)
notes.eatonphil.com
Generating a full-stack application from a database
https://notes.eatonphil.com/generating-a-full-stack-application-from-a-database.html
8 comments
This is neat. What are some other projects in this space?
For Go, there's xo/xo, sqlboiler and gnorm. But they mostly are used to generate data access code only.
Hasura, couchdb, supabase and PostgREST wrap your database but don't generate code they just run in memory (and you have to deal with Haskell and Erlang).
Prisma is most similar in spirit but has it's own data description language whereas this uses SQL. This generates a Go backend currently (I'm working on Java though too) but Prisma generates typescript.
Hasura, couchdb, supabase and PostgREST wrap your database but don't generate code they just run in memory (and you have to deal with Haskell and Erlang).
Prisma is most similar in spirit but has it's own data description language whereas this uses SQL. This generates a Go backend currently (I'm working on Java though too) but Prisma generates typescript.
Just to clarify :)
> PostgREST wrap your database but don't generate code they just run in memory.
PostgREST generates an OpenAPI output, which in turn can generate code with tools such as openapi-generator[1], Go being one of the many langs supported.
> (and you have to deal with Haskell and Erlang)
I guess this is only as true as saying that you have to deal with Erlang because you use RabbitMQ. Or you have to deal with C because you use PostgreSQL. Same applies with PostgREST, you don't have to write Haskell to use it, only SQL.
[1]: https://openapi-generator.tech
> PostgREST wrap your database but don't generate code they just run in memory.
PostgREST generates an OpenAPI output, which in turn can generate code with tools such as openapi-generator[1], Go being one of the many langs supported.
> (and you have to deal with Haskell and Erlang)
I guess this is only as true as saying that you have to deal with Erlang because you use RabbitMQ. Or you have to deal with C because you use PostgreSQL. Same applies with PostgREST, you don't have to write Haskell to use it, only SQL.
[1]: https://openapi-generator.tech
> First the server is written in Haskell using the Warp HTTP server (aka a compiled language with lightweight threads).
From the PostgREST readme. Even if you generated the controllers with openapi, I'm not aware that openapi will generate you an entire application already hooked up to the db?
> guess this is only as true as saying that you have to deal with Erlang because you use RabbitMQ. Or you have to deal with C because you use PostgreSQL. Same applies with PostgREST, you don't have to write Haskell to use it, only SQL.
In my experience you will undoubtedly end up dealing with the oddities of it as some point. Would you rather deal with oddities in Haskell or in C? For most of the world, for better or worse, C (or Go or Java) is probably more pragmatic.
From the PostgREST readme. Even if you generated the controllers with openapi, I'm not aware that openapi will generate you an entire application already hooked up to the db?
> guess this is only as true as saying that you have to deal with Erlang because you use RabbitMQ. Or you have to deal with C because you use PostgreSQL. Same applies with PostgREST, you don't have to write Haskell to use it, only SQL.
In my experience you will undoubtedly end up dealing with the oddities of it as some point. Would you rather deal with oddities in Haskell or in C? For most of the world, for better or worse, C (or Go or Java) is probably more pragmatic.
Thanks, PostgREST looks fantastic: one of those “I can’t believe I didn’t know this was available” moments.
I figured I should check who this was before leaving the thread go... Should have checked before commenting originally too. :D
I did not know about openapi-generator. Very interesting.
But what's the benefit of having PostgREST involved in this scenario?
I did not know about openapi-generator. Very interesting.
But what's the benefit of having PostgREST involved in this scenario?
Thanks, this is very helpful.
hey eatonphil, Really happy to come across this. Cool stuff.
We launched[1] XgeneCloud last week. https://github.com/xgenecloud/xgenecloud
And XgeneCloud also generates source code for REST APIs & GraphQL APIs with auth and ACL. The source code is in Express.js/Node.js - We support MySQL, PostgreSQL, MSSQL, SQLite and MariDB.
[1] : https://news.ycombinator.com/item?id=23466782
We launched[1] XgeneCloud last week. https://github.com/xgenecloud/xgenecloud
And XgeneCloud also generates source code for REST APIs & GraphQL APIs with auth and ACL. The source code is in Express.js/Node.js - We support MySQL, PostgreSQL, MSSQL, SQLite and MariDB.
[1] : https://news.ycombinator.com/item?id=23466782