Questions tagged [jugglingdb]

JugglingDB is cross-db ORM for nodejs, providing common interface to access most popular database formats.

According to this source JugglingDB is:

A cross-db ORM for nodejs, providing common interface to access most popular database formats. Currently supported are: MySQL, sqlite3, PostgreSQL, couchdb, mongodb, redis, neo4j and js-memory-storage (yep, self-written engine for test-usage only). You can add your favorite database adapter, checkout one of the existing adapters to learn how, it's super-easy, I guarantee.

Jugglingdb also works on client-side (using WebService and Memory adapters), which allows to write rich client-side apps talking to server using JSON API.

34 questions
5
votes
3 answers

Loopback 2.4: how to query certain fields of related model via REST API

I have User model over relational DB. Each User can hasMany "users" where "chiefId" is FK. "relations": { "users": { "type": "hasMany", "model": "User", "foreignKey": "chiefId" }, } I can query related users for each…
IvanZh
  • 2,265
  • 1
  • 18
  • 26
5
votes
1 answer

Compoundjs fails to run with jugglingdb-mysql

Trying to test compoundjs with mysql but it fails. My system is Debian 7 with following versions of nodejs & npm $ node -v v0.10.13 $ npm -v 1.3.4 Here is how I installed compoundjs sudo npm install -g compound sudo npm install -g jugglingdb…
Manraj Singh
  • 143
  • 4
4
votes
0 answers

No response after database-access in jugglingdb

I try to use my compound.js-application as a (transparent) proxy-server. When a user tries to request a external website, the application will check, if the user with that ip-address was authenticated before. If so, the external site will be shown,…
David Geh
  • 307
  • 1
  • 2
  • 12
2
votes
1 answer

Loopback: return error from beforeValidation hook

I need to make custom validation of instance before saving it to MySQL DB. So I perform (async) check inside beforeValidate model hook. MyModel.beforeValidate = function(next){ // async check that finally calls next() or next(new…
IvanZh
  • 2,265
  • 1
  • 18
  • 26
2
votes
0 answers

How can I have composite primary key schema in JugglingDB?

I have a table in mysql that has a composite primary key.How can i define this schema in jugglingDB. var User = schemaDynamo.define('User', { userId : { type: Number}, deptId : {type: Number} .... column userId and deptId together make the primary…
Hmahwish
  • 2,222
  • 8
  • 26
  • 45
2
votes
1 answer

Understanding Try/Catch and Domains for Error Handling in Node

I've been researching the proper way to handle errors in Node and have found some good answers here on StackOverflow and on NodeJS' site, such as How do I prevent node.js from crashing? try-catch doesn't work and the NodeJS docs themselves:…
Aaron Storck
  • 886
  • 7
  • 16
2
votes
0 answers

Can I have Multiple Schema Objects in JugglingDB?

I have a simple application that connects to two datasources. One being mongo, in which I use mongoose for my ORM, mainly because it has some great functionality for my use. The other is mysql which I am using jugglingdb with the mysql adapter. As…
britztopher
  • 1,214
  • 2
  • 16
  • 26
2
votes
1 answer

How do I get the native mongodb client from a jugglingdb adapter during compoundjs initialization?

I'm working with compoundjs and using the mongodb adapter of jugglingdb. I've been retrieving and reusing the native mongodb client in the controllers by doing the following: var db = compound.orm._schemas[0].client; This works great, as I am able…
matth
  • 6,112
  • 4
  • 37
  • 43
2
votes
1 answer

JugglingDB custom query

I am trying to figure how to create a "repository" file (for the symfony2 users) where i will put all my special behaviour queries. I have a simple db shema with : User (email) RelationType (name) UserXUserXRelation (fromUser, toUser, relation) I…
Jihel
  • 796
  • 1
  • 5
  • 13
2
votes
1 answer

How to add a custom property to model in jugglingdb and have it returned via JSON

How do I add a custom property to a jugglingdb model? I want to define a custom property specifically versus a custom method because I want to return it to the client. Here is an example using the ubiquitous Post model: db/schema.js: var Post =…
absynce
  • 1,399
  • 16
  • 29
2
votes
1 answer

Using arbitrary mySQL Query with JugglingDB?

I am currently using juggling db with NodeJS for ORM. I now need to do some reporting, which involves joining data from several tables using arbitrary SQL with SUM and GROUP BY too. How would I do this using the jugglingdb framework, and get a list…
nwaltham
  • 2,067
  • 1
  • 22
  • 40
2
votes
1 answer

compound db update/migrate not working in mysql

I've followed this guide http://compoundjs.com/docs to create a very basic REST server. It worked when using memory as storage. After that, I tried to move to mysql. When executing "compound db migrate" (or update) the response is: Perform migrate…
2
votes
1 answer

Compound JS Relationship Access

I have defined 2 schema objects as below (for use in a mongodb) var User = describe('User', function () { property('name', String); property('email', String); property('password', String); set('restPath', pathTo.users); }); var…
Mike Wade
  • 1,726
  • 1
  • 15
  • 28
2
votes
1 answer

nodejs jugglingdb belongsTo and hasMany relations with existing db objects

jugglingdb exposes two functions to create relational dbs: belongsTo and hasMany i now aks myself how i might use this in daily development. belongsTo and hasMany are adding functions to the objects, but as it seems there is no way to create…
1
vote
1 answer

New node.js app using legacy database, new database, and Redis caching layer

We're developing a new version of our site using Node, but we need to continue using a legacy mysql database as-is yet also add new fields to some models via new tables in a new database, AND add a caching layer. What's the best way to do this? We…
steev
  • 916
  • 10
  • 24
1
2 3