golang-database-library-orm-example
todo-list-api
Our great sponsors
golang-database-library-orm-example | todo-list-api | |
---|---|---|
4 | 1 | |
21 | 2 | |
- | - | |
0.0 | 0.0 | |
about 1 year ago | about 1 year ago | |
Go | Go | |
- | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
golang-database-library-orm-example
-
Golang Database Library and Orm Examples
What I found is sqlx and sqlc are excellent for hand-rolled queries, but is poor for dynamic queries which a query builder library/orm might suite better. If there are many eager-loading table relationships, I found that orms tend to be much better. Of course these are entirely my personal opinion. I dove into more details on how each libraries and orms fares against those operations in the posts. It is also accompanied with reproducible repo at https://github.com/gmhafiz/golang-database-library-orm-example
-
Dynamic sql code during runtime.
I discussed approaches using different libraries and ORMs at https://www.gmhafiz.com/blog/golang-database-library-orm-example-dynamic-list/. Though I just realised the example for squirrel is missing. Check out the code examples though
-
Scanning joined SQL rows into nested go struct
I show scans for a many to many relationship between two tables. https://github.com/gmhafiz/golang-database-library-orm-example/blob/master/db/sqlc/manyToMany.go
-
What kind of things have you ran with go:generate?
I made repo that compares between different libraries and orms including sqlx, sqlc, sqlboiler, gorm, and ent https://github.com/gmhafiz/golang-database-library-orm-example
todo-list-api
-
Building CRUD Operations in Golang ๐
You can find the complete code repository for this tutorial here ๐Github
What are some alternatives?
bob - SQL query builder and ORM/Factory generator for Go with support for PostgreSQL, MySQL and SQLite
fiber-boilerplate - This is the go boilerplate on the top of fiber web framework. With simple setup you can use many features out of the box
optional - Optional is a library of optional Go types
backend - A REST web-service sample project written in Golang using go-fiber, GORM and PostgreSQL
ent - An entity framework for Go
golang-gin-realworld-example-app - Exemplary real world application built with Golang + Gin
gorm-seeder - Gorm seeder package
ecommerce - A fully functional Ecommerce API in GO GIN Framework and mongoDB with JWT Authentication
sqlc - Generate type-safe code from SQL
go-boilerplate - Starter for golang projects
jwt-auth-api - JWT Authentication Implementation in Golang
microservices-go - Golang Microservice Boilerplate using MySQL, Docker and Swagger, API REST. Gin Go and GORM with pagination and implementation of a Clean Architecture.