Earlier quoted context omitted.
> I don't find that creating types to make this contract explicit takes much time at all This depends on the complexity of your schema. In my case, I was dealing with a 230 table legacy application where some of the tables had as many as 70 columns. I was tasked with building an ad-hoc administrative tool for the owners so that they could perform a few specific tasks and periodically review some information in the sy…
Sounds like a poor ORM. I've never had to enumerate the entire schema, just the tables/columns I actually utilize in code.
BookShelf, Simple ORM for Node
21–27 of 27 posts
Re: BookShelf, Simple ORM for Node
#22Earlier quoted context omitted.
On the other hand, this behavior is quite nice if you want to quickly build something around an existing database and you don't really want to spend time reenumerating the entire schema in code before being able to leverage the ORM.
Honestly, if I know what the database looks like, I'd rather use babel with string templates for building parameterized queries against the database directly. [1] [2] It seems to me that the layers of ORM (in JS) don't really buy you much more than some simple validation wrappers and a simpler client for SQL queries. After having used a number of ORMs in static environments (mostly C#), I'm much more inclined to pref…
Re: BookShelf, Simple ORM for Node
#23Earlier quoted context omitted.
Sounds like a poor ORM. I've never had to enumerate the entire schema, just the tables/columns I actually utilize in code.
Ok, but what I'm saying is that I didn't have to enumerate any schema in this case. I understand the benefits of doing so, but it's sometimes desirable to just get something running rather than spend time mapping your ORM to your schema. If I wrote the SQL directly, I also wouldn't need to enumerate my columns in advance, but bookshelf offers some of the conveniences of an ORM without adding an additional configurati…
Re: BookShelf, Simple ORM for Node
#24It 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.
Re: BookShelf, Simple ORM for Node
#25Earlier quoted context omitted.
Ok, but what I'm saying is that I didn't have to enumerate any schema in this case. I understand the benefits of doing so, but it's sometimes desirable to just get something running rather than spend time mapping your ORM to your schema. If I wrote the SQL directly, I also wouldn't need to enumerate my columns in advance, but bookshelf offers some of the conveniences of an ORM without adding an additional configurati…
It takes all of seconds to type out a few field names. =/
He keeps going on about SQL not requiring it, but SQL requires it in every statement (the select clause).
I'd hate to be the one who has to maintain an admin app that could potentially access 230 tables with dynamic column references scattered all throughout the code and no types to keep things in order.
Re: BookShelf, Simple ORM for Node
#26Earlier quoted context omitted.
It takes all of seconds to type out a few field names. =/
Not only that, he actually already is doing this when he accesses those fields in code implicitly. He keeps going on about SQL not requiring it, but SQL requires it in every statement (the select clause). I'd hate to be the one who has to maintain an admin app that could potentially access 230 tables with dynamic column references scattered all throughout the code and no types to keep things in order.
haha a string of SQL is not the same thing as a type constrained data structure.
> I'd hate to be the one who has to maintain an admin app that could potentially access 230 tables with dynamic column references scattered all throughout the code and no types to keep things in order.
Thankfully, the client used a database that is capable of enforcing type constraints automatically, so I didn't have to spend time writing business logic to reiterate what the database already knows and strictly enforces, in a language that can't even enforce type constraints anyway. Re-declaring your column names and types in javascript literally does nothing except waste time. You shouldn't be reading through your application code to understand the schema of your database, especially when you're dealing with hundreds of tables.
Re: BookShelf, Simple ORM for Node
#27http://stackoverflow.com/questions/32777559/how-to-join-3-ta...