TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

DenoDB

220 pointsby 0xedbalmost 4 years ago

21 comments

flakinessalmost 4 years ago
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&#x2F;C++ SDK.)<p>Deno PG [1] and MySQL [2] does it. This makes sense considering Deno&#x27;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&#x27;s such a hassle.<p>Anyways, kudos to both communities. You&#x27;ve done a lot!<p>- [1] <a href="https:&#x2F;&#x2F;deno.land&#x2F;x&#x2F;postgres@v0.11.2" rel="nofollow">https:&#x2F;&#x2F;deno.land&#x2F;x&#x2F;postgres@v0.11.2</a><p>- [2] <a href="https:&#x2F;&#x2F;deno.land&#x2F;x&#x2F;mysql@v2.9.0" rel="nofollow">https:&#x2F;&#x2F;deno.land&#x2F;x&#x2F;mysql@v2.9.0</a><p>- [3] <a href="https:&#x2F;&#x2F;github.com&#x2F;brianc&#x2F;node-postgres&#x2F;tree&#x2F;master&#x2F;packages&#x2F;pg" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;brianc&#x2F;node-postgres&#x2F;tree&#x2F;master&#x2F;packages...</a><p>- [4] <a href="https:&#x2F;&#x2F;github.com&#x2F;mysqljs&#x2F;mysql" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mysqljs&#x2F;mysql</a>
评论 #27547204 未加载
评论 #27547620 未加载
评论 #27547246 未加载
评论 #27550468 未加载
评论 #27548673 未加载
brainlessalmost 4 years ago
Every time we discuss an ORM project, someone is bound to complain about ORMs in general.<p>I have a small suggestion: please try ORMs in different languages. A lot of the power of an ORM depends on the language. Your ORM may not be the same as my ORMs - Django ORM, SQLAlchemy, Pony ORM. Try them and you will know why. I will wait.<p>From my limited understanding, the language needs to allow reflecting and manipulating your model definitions (like a model Class) which define the data model as a set of tuples (field name and field type, which is a representation of SQL type) into instances that hold data in the native types of the programming language and &quot;magically&quot; convert them to the SQL types. It usually falls under the realm of meta programming and is not exactly a first-class feature in many languages.<p>I am totally not a language expert and perhaps did not articulate this well enough, but if you are curious just search a bit and try. Just my 2 Rupees.
评论 #27552002 未加载
评论 #27551420 未加载
评论 #27550268 未加载
评论 #27550414 未加载
评论 #27552025 未加载
评论 #27550018 未加载
评论 #27552182 未加载
评论 #27554293 未加载
Possiblyheroinalmost 4 years ago
You can&#x27;t yet have multiple where conditions seperated by an OR operator. I&#x27;ve been using this library for a side project and unfortunately I just don&#x27;t think it&#x27;s mature for production use cases yet.<p>Hopefully it keeps maturing as it otherwise shows quite a bit of promise.
Osirisalmost 4 years ago
I hate ORMs with the fury of a thousand suns.<p>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.<p>I&#x27;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.<p>Currently I&#x27;m looking at pg-types because you just write SQL and it just helps by making some TypeScript types for you.<p>(I have used ORMs in C#, PHP, and JavaScript and I hate all of them).
评论 #27547182 未加载
评论 #27547343 未加载
评论 #27547247 未加载
评论 #27547399 未加载
评论 #27551247 未加载
评论 #27547486 未加载
评论 #27547324 未加载
评论 #27547864 未加载
评论 #27547926 未加载
评论 #27548056 未加载
评论 #27547859 未加载
评论 #27547669 未加载
评论 #27547610 未加载
评论 #27547479 未加载
评论 #27548555 未加载
评论 #27547504 未加载
评论 #27548759 未加载
评论 #27547403 未加载
评论 #27547328 未加载
评论 #27547276 未加载
vinkelhakealmost 4 years ago
I&#x27;ve been using [1] which is SQLite compiled to WASM (what a weird world we&#x27;re in now). It&#x27;s got some limitations and caveats, but it&#x27;s working well for my current modest needs. It&#x27;s a pretty straightforward wrap of the SQLite API - no ORM. The advantage is that it doesn&#x27;t depend on having anything installed. Just import and you&#x27;re good to go.<p>[1] <a href="https:&#x2F;&#x2F;deno.land&#x2F;x&#x2F;sqlite@v2.4.2" rel="nofollow">https:&#x2F;&#x2F;deno.land&#x2F;x&#x2F;sqlite@v2.4.2</a>
评论 #27550355 未加载
burlesonaalmost 4 years ago
Is it just me or is it weird to see an ORM that wraps over 4 relational databases and… Mongo…
评论 #27547125 未加载
评论 #27547121 未加载
breatheoftenalmost 4 years ago
At first glance -- async&#x2F;await mitigates a lot of my least favorite things about orm dsl&#x27;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 ...
评论 #27547311 未加载
mirekrusinalmost 4 years ago
Personally I prefer functional combinators like interfaces [0]. Js&#x2F;ts have tagged templates which enhances those type of interfaces a lot. It gives access to full set of functionality of underlying database, not just common denominator of all used. It allows arbitrary compositions etc.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;appliedblockchain&#x2F;tsql&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;appliedblockchain&#x2F;tsql&#x2F;</a>
__jemalmost 4 years ago
Really dislike active record style ORMs. Even if the entities are proxies w&#x2F; some magic (e.g. lazy loading), they should still read like plain records in the code, and be programmed with a data-first style. Because methods accumulate on these active record entities, I’ve found devs tend to treat them more “thingly” than just data projections. The user doesn’t save itself. It’s just a row in a database.
评论 #27551401 未加载
评论 #27547454 未加载
ttfkamalmost 4 years ago
If you want an ORM, use GraphQL. It has the one thing missing in all other ORMs: it&#x27;s a spec, not an implementation. Don&#x27;t like one vendor, swap in another without breaking upstream services. Seriously, folks really underestimate the benefits of a published spec over a sea of inconsistent implementations.<p>Learn one ORM, you&#x27;re SOL when the new team uses a different one. Time to start over again. Got a bug in your ORM? Hope they fix it, because migrating to another ORM is more painful than migrating SQL syntax. Need to work around the ORM? Why do you even have an ORM?<p>Can you imagine browsers if they didn&#x27;t standardize on HTTP? Tied to a particular vendor&#x27;s server or having ten different wire protocols competing?<p>That&#x27;s where ORMs are now without a spec. It&#x27;s insanity.
tgeorgealmost 4 years ago
I&#x27;ve played with SQLAlchemy and Django&#x27;s ORM in the past with Python but as of late I have been taking a liken to Eloquent while working with PHP&#x27;s Laravel. It&#x27;s always weird trying an ORM when coming from native SQL but I think eloquent might of found a happy medium as it seems flexible to me.<p><a href="https:&#x2F;&#x2F;laravel.com&#x2F;docs&#x2F;8.x&#x2F;eloquent" rel="nofollow">https:&#x2F;&#x2F;laravel.com&#x2F;docs&#x2F;8.x&#x2F;eloquent</a>
评论 #27552397 未加载
phplovesongalmost 4 years ago
During my years as a dev i have really started to dislike ORMs. They always fail in the end. SQL is universal, and transfers between languages and tech fields. This is why im pro-sql, and always try to avoid unnecessary abstractions.<p>I have actually went back to writing pure SQL in files, and using those as params for whatever db engine i use, this makes it even possible to reuse the code in other projects (even its unlikely that you can use the exact same query, but just as a &quot;it would work&quot; in theory).<p>For node based projects i have used and would probably still choose pg-promise (<a href="https:&#x2F;&#x2F;github.com&#x2F;vitaly-t&#x2F;pg-promise" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;vitaly-t&#x2F;pg-promise</a>).
评论 #27549001 未加载
评论 #27548076 未加载
评论 #27547923 未加载
评论 #27548815 未加载
评论 #27549105 未加载
评论 #27549424 未加载
评论 #27549194 未加载
评论 #27556822 未加载
评论 #27548149 未加载
评论 #27548871 未加载
评论 #27548748 未加载
评论 #27548494 未加载
评论 #27548429 未加载
评论 #27548137 未加载
评论 #27547912 未加载
评论 #27548630 未加载
FlashBlazealmost 4 years ago
I really recommend to check out his channel: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;c&#x2F;eveningkid" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;c&#x2F;eveningkid</a><p>One of the lower subscribed well produced tech channels I&#x27;ve seen in a while.
评论 #27547086 未加载
markstosalmost 4 years ago
So, pick a database, use DenoDB and then use the lowest-common-denominator feature set of all the databases it supports.<p>There&#x27;s a great parable from almost two decades ago.<p>Movable Type was a popular open source blogging platform that used an ORM and supported multiple database backends.<p>Wordpress only supported MySQL.<p>Remember Movable Type?<p>I hacked on both and preferred working with Perl and PostgreSQL but the ORM layer was a pain to use. Thousands of other developers apparently agreed, as the Wordpress extension ecosystem thrived and Movable Type bombed.
评论 #27551620 未加载
评论 #27550751 未加载
ilovwindowsalmost 4 years ago
ORMs are unnecessary abstraction.<p>Check out <a href="https:&#x2F;&#x2F;github.com&#x2F;ludbek&#x2F;sql-compose" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ludbek&#x2F;sql-compose</a><p>Tools like this are the future. It&#x27;s so simple yet flexible enough to handle any complex queries.<p>It scales infinitely.
评论 #27548451 未加载
kh_hkalmost 4 years ago
Is the general consensus that we are just happy slapping an &#x27;await&#x27; in front of instructions we want to execute sincronously, or I am missing some fundamental idea here?
评论 #27551424 未加载
nih0almost 4 years ago
Not to be too negative but I really appreciate Java&#x27;s DataSources and other abstractions every time I see some python&#x2F;node &quot;connectors&quot;.
croesalmost 4 years ago
Too bad that MS SQL is not included.
评论 #27547227 未加载
jakobdaboalmost 4 years ago
As a JS and async&#x2F;await outsider, just looking at the README example, can anybody please explain what&#x27;s the reason to have the <i>await</i> prefix syntax at all? At this rate it&#x27;s going to be all over the place. If the function is asynchronous, what&#x27;s the difference for the caller? Can&#x27;t it just be omitted?
评论 #27548215 未加载
评论 #27548166 未加载
atarianalmost 4 years ago
The link and title made it seem like something official from the Deno developers but it&#x27;s just a mirror for <a href="https:&#x2F;&#x2F;github.com&#x2F;eveningkid&#x2F;denodb" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;eveningkid&#x2F;denodb</a>
评论 #27547470 未加载
评论 #27547710 未加载
sergiomatteialmost 4 years ago
Holy shit, this is actually a killer app in Deno.<p>Great work developers!