Alternatives to GORM logo

Alternatives to GORM

Beego, Hibernate, SQLAlchemy, Prisma, and Sequelize are the most popular alternatives and competitors to GORM.
156
122
+ 1
0

What is GORM and what are its top alternatives?

GORM is a popular Object-Relational Mapping (ORM) library for the Go programming language. It simplifies database interactions by providing a fluent interface for querying, updating, and managing database records. Key features of GORM include automatic schema creation, relationships mapping, and support for different database dialects. However, GORM may suffer from performance issues with complex queries and lack of support for NoSQL databases.

  1. XORM: XORM is an ORM library for Go that aims to be both powerful and flexible. It supports various database backends, has transparent caching, and provides automatic schema update features. Pros: Good performance, easy to use, and support for multiple databases. Cons: Documentation could be improved, and learning curve can be steep for beginners.

  2. sqlx: sqlx is a library that extends the standard database/sql package in Go. It provides a set of extensions that add support for queries, transactions, and prepared statements. Key features include better support for scanning values into structs and mapping column names to struct fields. Pros: Lightweight, simple and efficient, good performance. Cons: Limited features compared to full-fledged ORMs like GORM.

  3. pgx: pgx is a PostgreSQL driver and toolkit for Go. It aims to provide low-level access to the database while still offering convenience features like connection pooling and query execution helpers. Pros: High performance, support for advanced PostgreSQL features, and efficient connection pooling. Cons: Requires more manual handling compared to ORM libraries like GORM.

  4. Storm: Storm is an ORM-like library for Go that focuses on simplicity and ease of use. It provides a high-level API for interacting with BoltDB, a key-value store in Go. Key features include automatic indexing, querying, and schema migration. Pros: Lightweight, easy to learn, and good for small to medium-sized projects. Cons: Limited support for complex relationships and lacks features found in traditional ORMs like GORM.

  5. upper.io/db: Upper.io is a database abstraction layer for Go that simplifies database interactions. It supports multiple database backends and provides a fluent query builder interface. Key features include support for transactions, automatic schema management, and a clean API design. Pros: Easy to use, good performance, and support for multiple databases. Cons: Limited support for complex queries and lacks some advanced ORM features.

  6. Gorp: Gorp is a lightweight ORM library for Go that aims to provide a simple and efficient way to interact with databases. It supports both SQL and NoSQL databases and provides features like automatic schema mapping, relationships, and simple query interface. Pros: Lightweight, easy to use, and good performance. Cons: Limited support for complex queries and lacks some advanced features found in more extensive ORM libraries like GORM.

  7. Dbr: Dbr is a lightweight, idiomatic wrapper around database/sql for Go. It aims to simplify database interactions by providing a set of helpers for building queries, inserting, updating, and deleting records. Key features include query building, SQL generation, and support for transactions. Pros: Lightweight, easy to use, and good performance. Cons: Limited features compared to full-fledged ORMs like GORM.

  8. pop: Pop is an ORM for Go that emphasizes simplicity, flexibility, and speed. It provides a fluent query builder interface, support for multiple databases, and automatic schema management. Key features include relationships mapping, transactions, and advanced query capabilities. Pros: Easy to learn, good performance, and support for multiple databases. Cons: Limited community support compared to more established ORM libraries like GORM.

  9. ent: Ent is an entity framework for Go that focuses on runtime schema generation, type-safe queries, and edge-oriented modeling. It provides a DSL for defining schema, querying data, and managing relationships. Key features include schema migration, code generation, and query optimizations. Pros: Powerful query capabilities, type-safe APIs, and good performance. Cons: Relatively new in the market, limited community adoption compared to more established libraries like GORM.

  10. gormt: Gormt is a tool that generates Go struct definitions from an existing GORM model in a database. It simplifies the process of migrating between database schemas and Go struct definitions, especially when working with GORM. Pros: Easy to use, time-saving, and simplifies schema definition. Cons: Limited to working with GORM, may not suit projects using different ORMs or database libraries.

Top Alternatives to GORM

  • Beego
    Beego

    It is a RESTful HTTP framework for the rapid development of Go applications including APIs, web apps and backend services with integrated Go specific features such as interfaces and struct embedding. ...

  • Hibernate
    Hibernate

    Hibernate is a suite of open source projects around domain models. The flagship project is Hibernate ORM, the Object Relational Mapper. ...

  • SQLAlchemy
    SQLAlchemy

    SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL. ...

  • Prisma
    Prisma

    Prisma is an open-source database toolkit. It replaces traditional ORMs and makes database access easy with an auto-generated query builder for TypeScript & Node.js. ...

  • Sequelize
    Sequelize

    Sequelize is a promise-based ORM for Node.js and io.js. It supports the dialects PostgreSQL, MySQL, MariaDB, SQLite and MSSQL and features solid transaction support, relations, read replication and more. ...

  • Entity Framework
    Entity Framework

    It is an object-relational mapper that enables .NET developers to work with relational data using domain-specific objects. It eliminates the need for most of the data-access code that developers usually need to write. ...

  • Entity Framework Core
    Entity Framework Core

    It is a lightweight, extensible, open source and cross-platform version of the popular Entity Framework data access technology. It can serve as an object-relational mapper (O/RM), enabling .NET developers to work with a database using .NET objects, and eliminating the need for most of the data-access code they usually need to write. ...

  • ent
    ent

    It is a simple, yet powerful entity framework for Go, that makes it easy to build and maintain applications with large data-models. ...

GORM alternatives & related posts

Beego logo

Beego

50
95
0
An open-source, high-performance web framework for the Go programming language
50
95
+ 1
0
PROS OF BEEGO
    Be the first to leave a pro
    CONS OF BEEGO
      Be the first to leave a con

      related Beego posts

      Shared insights
      on
      Gin GonicGin GonicBeegoBeegoGolangGolang

      Hi - I'm learning Go and I'd like to make a simple web app for starting. I would like an advice on the best between Beego and Gin Gonic as web framework. Thanks.

      See more
      Hibernate logo

      Hibernate

      1.5K
      1.1K
      33
      Idiomatic persistence for Java and relational databases.
      1.5K
      1.1K
      + 1
      33
      PROS OF HIBERNATE
      • 22
        Easy ORM
      • 8
        Easy transaction definition
      • 3
        Is integrated with spring jpa
      CONS OF HIBERNATE
      • 3
        Can't control proxy associations when entity graph used

      related Hibernate posts

      SQLAlchemy logo

      SQLAlchemy

      947
      498
      7
      The Python SQL Toolkit and Object Relational Mapper
      947
      498
      + 1
      7
      PROS OF SQLALCHEMY
      • 7
        Open Source
      CONS OF SQLALCHEMY
      • 2
        Documentation

      related SQLAlchemy posts

      Hello everybody! I want to create an easy to use website (and simplified) builder. Users create a site, add their domain and edit Pages inside an Admin Area inside predefined "Blocks" like with Wagtail.

      There should be several default templates/themes and layouts. Choosing a different theme might change both the layout and styling. And I'm looking for SSR or SSG with a focus on the end-user's Page performance.

      Current Stack:

      • GraphQL for the dynamic part (for example data to Pricing might not be required on the homepage, or images might go into gallery in one theme, and on the homepage in another theme)

      • FastAPI and SQLAlchemy to store Data. I have prior experience with Wagtail and Django and want to stay with Python and learn Fastapi

      • NGINX to handle domain-specific things (the how is not yet refined)

      I want a scalable architecture and especially a fast frontend. I'm tending to use SvelteKit, but I'm afraid that the dynamic part won't make me happy after having hundreds of sites, as the bundler cannot load themes dynamically. sveltekit - dynamic import

      I want to handle the scenario: Admin-User chooses a theme and other options for the site (domain) and the End-User Frontend/Session/Cookie will have to fetch and store data about the theme and load subsequent calls to prerendered sites.

      Also the "hundreds of sites" might not be all covered by 5 Themes, because users may purchase a custom-made theme, and I would have to manage one big project having lots of different Styleguides and flows. I even thought of statically building the site whenever the user makes a change, maybe using Hugo (or VitePress?). Then I would have to take more care with the page recreation and it would be easily routable instead of nesting every component with logic in the frontend... I think. But this I haven't thought through yet.

      Can anyone please help?

      See more
      Django Stars
      Developer at Django Stars · | 3 upvotes · 223.9K views

      Merging Django ORM with SQLAlchemy for Easier Data Analysis (Video Inside)

      Development of products with Django framework is usually easy and straightforward; great documentation, many tools out of the box, plenty of open source libraries and big community. Django ORM takes full control about SQL layer protecting you from mistakes, and underlying details of queries so you can spend more time on designing and building your application structure in Python code. However, sometimes such behavior may hurt - for example, when you’re building a project related to data analysis. Building advanced queries with Django is not very easy; it’s hard to read (in Python) and hard to understand what’s going on in SQL-level without logging or printing generated SQL queries somewhere. Moreover, such queries could not be efficient enough, so this will hit you back when you load more data into DB to play with. In one moment, you can find yourself doing too much raw SQL through Django cursor, and this is the moment when you should do a break and take a look on another interesting tool, which is placed right between ORM layer and the layer of raw SQL queries.

      See more
      Prisma logo

      Prisma

      1K
      927
      54
      Modern Database Access for TypeScript & Node.js
      1K
      927
      + 1
      54
      PROS OF PRISMA
      • 12
        Type-safe database access
      • 10
        Open Source
      • 8
        Auto-generated query builder
      • 6
        Supports multible database systems
      • 6
        Increases confidence during development
      • 4
        Built specifically for Postgres and TypeScript
      • 4
        Productive application development
      • 2
        Supports multible RDBMSs
      • 2
        Robust migrations system
      CONS OF PRISMA
      • 2
        Doesn't support downward/back migrations
      • 1
        Doesn't support JSONB
      • 1
        Do not support JSONB
      • 1
        Mutation of JSON is really confusing
      • 1
        Do not support JSONB

      related Prisma posts

      Divine Bawa
      at PayHub Ghana Limited · | 16 upvotes · 483.1K views

      I just finished a web app meant for a business that offers training programs for certain professional courses. I chose this stack to test out my skills in graphql and react. I used Node.js , GraphQL , MySQL for the #Backend utilizing Prisma as a database interface for MySQL to provide CRUD APIs and graphql-yoga as a server. For the #frontend I chose React, styled-components for styling, Next.js for routing and SSR and Apollo for data management. I really liked the outcome and I will definitely use this stack in future projects.

      See more
      Collins Ogbuzuru
      Front-end dev at Evolve credit · | 11 upvotes · 25.6K views
      Shared insights
      on
      GraphQLGraphQLPrismaPrismaAWS LambdaAWS Lambda

      We are starting to build one shirt data logic, structure and as an online clothing store we believe good ux and ui is a goal to drive a lot of click through. The problem is, how do we fetch data and how do we abstract the gap between the Front-end devs and backend-devs as we are just two in the technical unit. We decided to go for GraphQL as our application-layer tool and Prisma for our database-layer abstracter.

      Reasons :

      GraphQL :

      1. GraphQL makes fetching of data less painful and organised.

      2. GraphQL gives you 100% assurance on data you getting back as opposed to the Rest design .

      3. GraphQL comes with a bunch of real-time functionality in form of. subscriptions and finally because we are using React (GraphQL is not React demanding, it's doesn't require a specific framework, language or tool, but it definitely makes react apps fly )

      Prisma :

      1. Writing revolvers can be fun, but imagine writing revolvers nested deep down, curry braces flying around. This is sure a welcome note to bugs and as a small team we need to focus more on what that matters more. Prisma generates this necessary CRUD resolves, mutations and subscription out of the box.

      2. We don't really have much budget at the moment so we are going to run our logic in a scalable cheap and cost effective cloud environment. Oh! It's AWS Lambda and deploying our schema to Lambda is our best bet to minimize cost and same time scale.

      We are still at development stage and I believe, working on this start up will increase my dev knowledge. Off for Lunch :)

      See more
      Sequelize logo

      Sequelize

      860
      1.4K
      142
      Easy-to-use multi SQL dialect ORM for Node.js
      860
      1.4K
      + 1
      142
      PROS OF SEQUELIZE
      • 42
        Good ORM for node.js
      • 31
        Easy setup
      • 21
        Support MySQL & MariaDB, PostgreSQL, MSSQL, Sqlite
      • 14
        Open source
      • 13
        Free
      • 11
        Promise Based
      • 4
        Recommend for mongoose users
      • 3
        Typescript
      • 3
        Atrocious documentation, buggy, issues closed by bots
      CONS OF SEQUELIZE
      • 30
        Docs are awful
      • 10
        Relations can be confusing

      related Sequelize posts

      Dieudonné ALLOGNON
      Junior Fullstack Developer · | 5 upvotes · 326.9K views

      Hey! I am actually in internship and have an app to create for my structure. It will be an intern app which will allow crud dashboard actions with some data provided by the use of an API of one of the structure partner and make a correspondence to data contained in a private database. Since it's an intern app, I thought about Electron for a desktop app because I did a lot of web with Laravel and the structure goes more for the desktop app. But it will be my first occasion working with this tech.

      Is Electron a good choice? Wich ORM should be more complete and adapted to this between Sequelize and TypeORM? (Database will be MySQL) Some charts will be displayed in the app. Is there a library (preferably without jQuery) that suits this stack?

      Thank you !

      See more
      Vyshnav KPI
      Application Developer at KPI suite tech · | 4 upvotes · 126.1K views
      Shared insights
      on
      SequelizeSequelizePrismaPrisma

      Can you help me with the following:

      1. What additional functionality is present in Prisma when compared with Sequelize?
      2. Is getter and setter method available in Prisma? If then please provide any reference or resource.
      3. Is Hooks, hierarchy present in Prisma?
      See more
      Entity Framework logo

      Entity Framework

      632
      232
      19
      An object-relational mapper that enables .NET developers to work with relational data
      632
      232
      + 1
      19
      PROS OF ENTITY FRAMEWORK
      • 6
        LINQ
      • 3
        Object Oriented
      • 3
        Strongly Object-Oriented
      • 2
        Multiple approach (Model/Database/Code) first
      • 2
        Code first approach
      • 1
        Auto generated code
      • 1
        Model first approach
      • 1
        Strongly typed entities
      • 0
        Database first
      CONS OF ENTITY FRAMEWORK
        Be the first to leave a con

        related Entity Framework posts

        Entity Framework Core logo

        Entity Framework Core

        451
        219
        16
        Lightweight and cross-platform version of the popular Entity Framework
        451
        219
        + 1
        16
        PROS OF ENTITY FRAMEWORK CORE
        • 7
          Fits very well with Microsoft technologies
        • 4
          Fast
        • 2
          Linq
        • 1
          OpenSource
        • 1
          Multiple Database provider
        • 1
          Easy to use
        CONS OF ENTITY FRAMEWORK CORE
        • 1
          Dbcontext

        related Entity Framework Core posts

        ent logo

        ent

        304
        26
        0
        An entity framework for Go
        304
        26
        + 1
        0
        PROS OF ENT
          Be the first to leave a pro
          CONS OF ENT
            Be the first to leave a con

            related ent posts