Skip to content

Conversation

LoicMahieu
Copy link
Contributor

js-data-sql works really great browser-side. I use it for manipulate a WebSql database and it works like a charm !
js-data is pretty amazing!

@LoicMahieu
Copy link
Contributor Author

In browserify context, if:

require('js-data') window.DSHttpAdapter = require('js-data-http') window.DSSqlAdapter = require('js-data-sql') require('js-data-angular') 

There is a bug in adapter registration:

null "new data store created" Defaults {…} null null null "registerAdapter" "http" DSHttpAdapter {defaults: Defaults} Object {} null "default adapter is http" null null null null "registerAdapter" "sql" DSHttpAdapter {defaults: Defaults} Object {} null "default adapter is http" null null null null "registerAdapter" "http" DSHttpAdapter {defaults: Defaults} Object {default: true} null "default adapter is http" null null null 

In adapter registration loop (https://github.com/js-data/js-data-angular/blob/master/src/index.js#L205-L214), if the first adapter is well registrated, it continue to loop over next adapter when with a wrong object.
Adding a break fix the issue. (in 846c4c0)

(I added a commit to current PR, if separate PR is preferable, just tell me)

@jmdobry
Copy link
Member

jmdobry commented Apr 15, 2015

Wow, I didn't even realize js-sql-adapter would be useful in the browser. And thanks for the fix!

jmdobry added a commit that referenced this pull request Apr 15, 2015
Add support of `js-data-sql` adapter
@jmdobry jmdobry merged commit 8a678e6 into js-data:master Apr 15, 2015
@LoicMahieu
Copy link
Contributor Author

@jmdobry Yeah. I thought I was crazy to dig into it but it works!
Seems to fail in CircleCI tests. Bower issue... Perhaps resolution ? https://circleci.com/gh/js-data/js-data-angular/44
CircleCI does not test PR ?

jmdobry added a commit that referenced this pull request Apr 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants