Does Go, has something similar to Laravel eloquent (ORM) ?

This page summarizes the projects mentioned and recommended in the original post on /r/golang

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • GORM

    The fantastic ORM library for Golang, aims to be developer friendly

  • Yes. I think the most popular is gorm (https://gorm.io). I use it myself and love it, but i know that many people are against using it. For simple queries, the code is looking really clean. If you have complex queries with e.g. sub selects, your code looks like a car accident.

  • ent

    An entity framework for Go

  • I've used https://entgo.io/ for a few years now. It's pretty good. A few quirks trying to get some things to do what I want, but overall easy to work with.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • sqlx

    general purpose extensions to golang's database/sql

  • I'd rather suggest the use of tools more aligned with the core concepts of the language such as sqlx, which is an extension of the database/sql standard library. It allows you to use models/structs to map your tables but you have more control over the SQL statements you use to perform queries and the like. You can combine sqlx with Squirrel to build queries from composable parts.

  • Squirrel

    Fluent SQL generation for golang

  • I'd rather suggest the use of tools more aligned with the core concepts of the language such as sqlx, which is an extension of the database/sql standard library. It allows you to use models/structs to map your tables but you have more control over the SQL statements you use to perform queries and the like. You can combine sqlx with Squirrel to build queries from composable parts.

  • jet

    Type safe SQL builder with code generation and automatic query result data mapping

  • Try go-jet, it generates the models based on the schema, provides typed column names.

  • sqlc

    Generate type-safe code from SQL

  • At the end of the day, it's up to you to decide how you want to work with your Database. Whether you like to write your own SQL query or let the ORM do it for you probably won't matter until you hit a certain scale anyway. If you're curious about others options, as many mentioned, SQLC (https://sqlc.dev/) is really a good one which is getting some traction these days. You basically write some SQL with placeholders in files and it compiles it for you into type-safe struct and code to interact with. Here is also a nice (and short) blog post explaining the options we have in the go ecosystem and the choice of the author to move to SQLC. https://brandur.org/sqlc

  • graphjin

    GraphJin - Build NodeJS / GO APIs in 5 minutes not weeks

  • This one looks interesting if you like GraphQL… https://graphjin.com

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts