Live data from Hacker News

DenoDB

github.com

11–20 of 220 posts

Re: DenoDB

#12
I hate ORMs with the fury of a thousand suns.

The problem is that I know SQL but now I have to spend a bunch of time trying to figure out how to convert SQL into ORM X just so it can convert it back to inefficient SQL. SQL mostly translates between various databases but ORMs are unique and you have to learn a new API for each one.

I'm on a project using TypeORM and it has been fantastic at helping developers on my team make really bad schemas due to not understanding how to use TypeORM to make the right relationships.

Currently I'm looking at pg-types because you just write SQL and it just helps by making some TypeScript types for you.

(I have used ORMs in C#, PHP, and JavaScript and I hate all of them).

Re: DenoDB

#13
post #8

Is it just me or is it weird to see an ORM that wraps over 4 relational databases and… Mongo…

Defining the schema in application ORM with Mongo seems helpful. While the DB doesn’t enforce a schema, I always want to have one.

Doesn't mongo support JSON Schema for document validation?

Re: DenoDB

#14
post #12

I hate ORMs with the fury of a thousand suns. The problem is that I know SQL but now I have to spend a bunch of time trying to figure out how to convert SQL into ORM X just so it can convert it back to inefficient SQL. SQL mostly translates between various databases but ORMs are unique and you have to learn a new API for each one. I'm on a project using TypeORM and it has been fantastic at helping developers on my te…

You're being downvoted, but I completely agree. If you are on Node and Postgres I highly recommend using slonik - it makes it easy to just write SQL but at the same time makes it almost impossible to have mistakes like SQL injections:

https://gajus.medium.com/stop-using-knex-js-and-earn-30-bf41...

https://github.com/gajus/slonik

Re: DenoDB

#16

Looking at the dependencies, I realized that it is now common to implement database bindings purely in the host language (vs. using vendor provided C/C++ SDK.) Deno PG [1] and MySQL [2] does it. This makes sense considering Deno's security model. But Node libs do the same [3][4]! This also kinda make sense, as node-based JS has to be async most of the time. Still it's such a hassle. Anyways, kudos to both communities…

It's because synchronous libraries that block don't play well with async event loop code like node or deno. You'd have to run them on a thread pool and pass data back and forth to avoid blocking.

This phenomenon also happens in go and rust for similar reasons.

Re: DenoDB

#18

Looking at the dependencies, I realized that it is now common to implement database bindings purely in the host language (vs. using vendor provided C/C++ SDK.) Deno PG [1] and MySQL [2] does it. This makes sense considering Deno's security model. But Node libs do the same [3][4]! This also kinda make sense, as node-based JS has to be async most of the time. Still it's such a hassle. Anyways, kudos to both communities…

Writing extensions in rust is also an option, not done it myself but it seems to use the systems shared library capabilities: https://blog.logrocket.com/how-to-create-a-deno-plugin-in-ru...

Re: DenoDB

#19
post #12

I hate ORMs with the fury of a thousand suns. The problem is that I know SQL but now I have to spend a bunch of time trying to figure out how to convert SQL into ORM X just so it can convert it back to inefficient SQL. SQL mostly translates between various databases but ORMs are unique and you have to learn a new API for each one. I'm on a project using TypeORM and it has been fantastic at helping developers on my te…

> the fury of a thousand suns

off topic, but I recently learn that this phrase dates back to the Bhagavad Gita!

    If the radiance of a thousand suns
    Were to burst at once into the sky
    That would be like the splendour of the Mighty One

Re: DenoDB

#20
At first glance -- async/await mitigates a lot of my least favorite things about orm dsl's -- namely that it can be difficult to tell when the orm framework is actually going to generate a db round trip without being familiar with the implementation ... thinking back to the most recent orm i had to learn (rails) and how it was quite annoying to get started with while interacting with an existing codebase. clear suspension marking would have made the code vastly easier to follow and allow making inferences about where things were happening even as a unfamiliar with the dsl ...
Post reply on HN