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.

BookShelf, Simple ORM for Node

57 pointsby squiggy22over 9 years ago

9 comments

bpicoloover 9 years ago
My biggest problem with bookshelf is that it automatically grabs column names, so you don't (by default) have any representation in code of what the dang model looks like. Since JS is not typed, this can lead to a lot of having no idea what might be going on unless you wrote the code yourself
评论 #10272548 未加载
评论 #10273679 未加载
HNcowover 9 years ago
Bookshelf isn't bad - but also make sure to check out knex, which Bookshelf is build on top of. Knex is a great Dapper like micro ORM/query builder if you'd just rather do most of your work in SQL.
statenjasonover 9 years ago
Good to see that it's using knex for queries. Many node ORMs dumb every database down to a Mongo-like object hash.
评论 #10273970 未加载
untogover 9 years ago
I was battling with Sequelize JS for a long time, then discovered Bookshelf. A breath of fresh air, it works so much better. Plus, the underlying library (Knex) is also fantastic for raw queries, migrations, etc.
评论 #10273241 未加载
评论 #10274209 未加载
评论 #10273960 未加载
Xantierover 9 years ago
For end to end usage samples and somewhat comparing to other DBs I can recommend my kitchen-sink project NERD-stack: <a href="https:&#x2F;&#x2F;github.com&#x2F;Xantier&#x2F;nerd-stack" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Xantier&#x2F;nerd-stack</a>
setheronover 9 years ago
When I used this back in the day, it was frustrating that the exceptions thrown by BookShelf would be a mismatch of: ValidationErrors, BookShelf errors, database specific errors.<p>It might be a comment on the JavaScript ecosystem but trying to collate all these myriad of exceptions into a single result to show my user was frustrating.
tuananhover 9 years ago
Can someone help me with this?<p><a href="http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;32777559&#x2F;how-to-join-3-tables-with-bookshelf-in-node-js" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;32777559&#x2F;how-to-join-3-ta...</a>
lsdafjklsdover 9 years ago
I think it&#x27;s the best ORM for Node. That said it makes me really miss Active Record, which is just... <i>sigh</i> the best.
steveklabnikover 9 years ago
I&#x27;ve really only used bookshelf in a pretty basic way, but I&#x27;ve been happy with it.