Live data from Hacker News

LoopBack, a new Node.js framework by StrongLoop

loopback.io

11–20 of 67 posts

Re: LoopBack, a new Node.js framework by StrongLoop

#12

Wow, I'm building something a bit similar in the Go area: https://github.com/sergiotapia/paprika Nice to know it's a good idea that a lot of people will find useful. :) Granted in it's current vision Paprika won't handle authentication. It's basically an API server in-a-can. Defined your structs, set up your .toml database configuration and paprika.Start("3000") on a port.

I've seen ton of "expose DB as REST-like API" libraries in various languages, and even tried (unsuccessfully) to write one myself. I'd say just exposing model is trivial, even when coupled with content-type negotiation. Subjectively, the hardest part is permissions (operation, row and field-level ones) and making them play nice with REST and HTTP concepts (like ETags).

Re: LoopBack, a new Node.js framework by StrongLoop

#13

Wow, I'm building something a bit similar in the Go area: https://github.com/sergiotapia/paprika Nice to know it's a good idea that a lot of people will find useful. :) Granted in it's current vision Paprika won't handle authentication. It's basically an API server in-a-can. Defined your structs, set up your .toml database configuration and paprika.Start("3000") on a port.

I've seen ton of "expose DB as REST-like API" libraries in various languages, and even tried (unsuccessfully) to write one myself. I'd say just exposing model is trivial, even when coupled with content-type negotiation. Subjectively, the hardest part is permissions (operation, row and field-level ones) and making them play nice with REST and HTTP concepts (like ETags).

etags , hateoas,hypermedia... definetly the hard part,along with security. Getting an API right is hard work.Still search for the holy grail...

Re: LoopBack, a new Node.js framework by StrongLoop

#18
This is slick, especially the API explorer, but my biggest gripe about these orm's is that once you get past the very basic CRUD, you need to execute custom sql.

Does it support custom DB types?

For example, I want my primary keys to be bigint on Mysql, and not have to override the underlying dbdriver to do the mapping. I'd prefer to set the appropriate dbtype in the model, and have the driver pass it along directly.

Also does it support dbdriver level SQL query execution?

I have custom aggregation query across a self join, and that's not easily represented with static methods on a model.

Today I use node-orm2, with a custom SQL script that updates the identity columns to be bigints, and it supports executing raw sql queries (with some basic parameter sanitizing).

Re: LoopBack, a new Node.js framework by StrongLoop

#19

This is slick, especially the API explorer, but my biggest gripe about these orm's is that once you get past the very basic CRUD, you need to execute custom sql. Does it support custom DB types? For example, I want my primary keys to be bigint on Mysql, and not have to override the underlying dbdriver to do the mapping. I'd prefer to set the appropriate dbtype in the model, and have the driver pass it along directly.…

Hooks would be nice for this. It's what Kinvey does and I think it's the best option. Want to run a special query or a special function? Have a hook that listens on the related queries, alter anything you like. You should also have direct access to raw database connection there, which is again, what Kinvey does.
Post reply on HN