What does HackerNews think of pure-orm?

A pure ORM for writing native SQL queries yielding pure business objects

Language: TypeScript

#48 in Database
#110 in JavaScript
#50 in Node.js
#50 in PostgreSQL
#44 in SQL
> The SQL is not really the point. It's about the rows and objects, moving the data from the objects to the INSERT statement, moving the data from the rows you SELECTed back to the objects.

If anyone is looking for this "pure" ORM (no query builder API) in Node there is https://github.com/craigmichaelmartin/pure-orm

Big fan of queries being written in SQL and yielding pure, properly structured business objects.

An example of this approach is PureORM[0]

[0]https://github.com/craigmichaelmartin/pure-orm

I would certainly hate for devs to hate on this top-secret pure orm project [0].

[0] https://github.com/craigmichaelmartin/pure-orm

PureORM[1] is an implemented thought experiment on what a "pure" object mapping library would look like - where you write regular native SQL and receive back properly structured (nested) pure business objects.

It would contrast against traditional ("stateful") ORMs which use query builders (rather than raw SQL) to return database-aware (rather than pure) objects.

The name pureORM reflects both that it is pure "ORM" (there is no query builder dimension) as well as the purity of the mapped Objects.

[1] https://github.com/craigmichaelmartin/pure-orm

Seems similar to PureORM[1]. It allows you to write regular native SQL and receive back properly structured (nested) pure business objects.

The name pureORM reflects both that it is pure ORM (there is no query builder dimension) as well as the purity of the mapped Objects.

[1] https://github.com/craigmichaelmartin/pure-orm

The issue I found with the raw SQL approach was receiving back flat results. I made PureORM[0] to do only and exactly that: map flat data to correctly nested business objects.

It is called "pure-orm" both because it is _purely_ an ORM (no query builder api), as well as because it returns _pure_ business objects (instead of db-aware objects).

[0] https://github.com/craigmichaelmartin/pure-orm

Yeah, ORMs have grown to mean more than mapping relational data to objects. An example of "just" this mapping can be seen in PureORM[0].

[0]: https://github.com/craigmichaelmartin/pure-orm

The things I've found positive about ORMs are exactly that mapping of results to business objects. The things I've found "not worth it" are the query-building APIs baked into the objects. These principles can be seen in a lightweight ORM I made, PureORM [1].

[1] https://github.com/craigmichaelmartin/pure-orm

Or use a "pure orm" (mapping to plain business objects) without a query builder - thus writing native sql and receiving nicely structured objects from the results (eg https://github.com/craigmichaelmartin/pure-orm)
> Fortunately, there are tools out there that solve the "mapping tables to objects" problem without trying to control all access to the database

In javascript land there is PureORM which seeks this balance (https://github.com/craigmichaelmartin/pure-orm)

The desire for the object mapping (to pure objects, not db-aware objects), while having an aversion to query building APIs led me to use https://github.com/craigmichaelmartin/pure-orm - where native, unobstructed SQL is written in a "data access layer", which returns pure "business objects" to be used in the app's business layer.