Objection to ORM Hatred

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • Appwrite - The Open Source Firebase alternative introduces iOS support
  • Scout APM - Truly a developer’s best friend
  • InfluxDB - Build time-series-based applications quickly and at scale.
  • talent.io - Download talent.io’s Tech Salary Report
  • SonarQube - Static code analysis for 29 languages.
  • Slick

    Slick (Scala Language Integrated Connection Kit) is a modern database query and access library for Scala (by slick)

    Many ORMs introduce a somewhat messy, complicated abstraction layer that doesn't actually get you the desired benefit in statically typed languages - compile time safety. Mainly because most languages do not have sufficiently powerful type systems.

    Exceptions are libraries like persist [1] for Haskell, Slick [2] for Scala, and - with caveats - Diesel [3] for Rust.

    But: manually mapping between the database domain and your domain objects is also a messy, error prone process that is wasted effort.

    My preferred solution is to stick with simple ORMs that just do simple mapping and provide a convenient query builder, without any heavy magic in the objects or any sort of automatic relationship logic (automatic fetching of joins, ...).

    [1] https://hackage.haskell.org/package/persistent

    [2] http://scala-slick.org/

    [3] http://diesel.rs/

  • Dapper.SimpleCRUD

    Who wants to write basic read/insert/update/delete statements? SimpleCRUD provides simple CRUD helpers for Dapper.

    I use dapper with a plugin called dapper.simplecrud (https://github.com/ericdc1/Dapper.SimpleCRUD). This already helps to reduce the need to write simple but error-prone SQL code quite a lot. When doing SQL operations more complicated than a simple crud, I resort to raw SQL or stored procedure.

  • Appwrite

    Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!

  • Atlas.Orm

    A data mapper implementation for your persistence model in PHP.

    > People always seem to ignore the third option: using an ORM that embraces SQL!

    I had a similar revelation several years ago, based on the distinctions between a "domain model" and "persistence model" described by Mehdi Khalili, resulting in Atlas for PHP: http://atlasphp.io

  • sql-template-tag

    ES2015 tagged template string for preparing SQL statements, works with `pg` and `mysql`

  • TypeORM

    ORM for TypeScript and JavaScript (ES7, ES6, ES5). Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.

    Does this correspond to the data mapper pattern? Seems like people mostly object to active record orm variants.


  • iodio

    Pure Functional Monadic Lazy Query Builder based on Knex,js powered by Fluture

    Considered it, but I think that there are advantage in programmatically construct the query (see for example knex modify). Directly write down SQL or use template with sql make it harder. The only problem with knex is that it mutate at every operation instead of returning a new instance. I'm experimenting in wrapping it in a lazy monad that return a Fluture (https://github.com/FbN/iodio)

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