Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support of js-data-sql adapter #328

Merged
merged 2 commits into from
Apr 15, 2015

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants