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

State of Dexie.js on Node.js using IndexedDBShim #325

Open
aral opened this issue May 29, 2018 · 3 comments
Open

State of Dexie.js on Node.js using IndexedDBShim #325

aral opened this issue May 29, 2018 · 3 comments

Comments

@aral
Copy link

aral commented May 29, 2018

I’m looking into using Dexie.js as an isomorphic database for my current project in browser and on Node.js. Dexie has a very comprehensive test suite that I just got running under Node.js (see pull request).

Based on the initial results, @dfahlander has written up an analysis and a summary of the current state of Dexie.js on Node.js using IndexedDBShim.

I’ve also indexed all the results of the failing tests in this issue: dexie/Dexie.js#709

I believe some of the issues (e.g., the failing tests on ordering/sorting) might be due to #296.

Would love to hear your thoughts on how best to proceed from here. @brettz9 / @axemclion Would it be possible for you, if you get a chance, to review/analyse/summarise the results like David did on the Dexie.js end. Once we have a roadmap of sorts, I will be happy to both look into those issues I can help out with myself as well as put out a call into the community so we can get others (including far better developers than me) to take a look at them :)

I’d love to see Dexie.js, combined with IndexedDBShim become a viable isomorphic database solution. And I hope this will help strengthen both projects as well as add another tool to our belt for creating more decentralised applications.

@dfahlander
Copy link

The ordering issue seems to be this: The shim's implementation of IDBIndex.getAll() ends up in a function named executeFetchIndexData() that does not apply an ORDER BY clause to the query. Rows are not returned in the order of the index.

@brettz9
Copy link
Collaborator

brettz9 commented May 30, 2018

@aral : This is awesome to see this develop.

A few things in response...

  1. @axemclion is not actively working on the project these days, but I'm happy to help as I can.
  2. As useful as it could be for us as well, I'm afraid I am too tied up these days to take the time to get the familiarity I need with the however appealing Dexie project to familiarize myself enough with the tests. If you can, like @dfahlander did, point to some specific potentially problematic functions, or still better, prepare vanilla IndexedDB test cases that expose the problem on our end (especially if not covered by our existing tests or by web-platform-tests from the W3C), I'd be happy to take a look as I have time.

@brettz9
Copy link
Collaborator

brettz9 commented May 30, 2018

Oh, and, since you appear to be looking long-term here, one key thing I should mention I hope we can get done, but which I'm not sure about finding the time to getting around to it, is the idea to get IndexedDB working in a manner by which it can be integrated into jsdom jsdom/jsdom#1748 (comment) .

The most complete Node simulation environment I have set up (which includes jsdom but also some of our own, IIRC, mostly incomplete polyfills of other browser methods missing in Node/jsdom) is within the w3c script tests (web-platform-tests).

FYI, besides requiring the recursive clone, these tests also requires the server running (see the package.json web-platform-tests and w3c scripts, including w3c-add-wrap which got the W3C tests working for IndexedDBShim via the browser as well, though I haven't been keeping up with the latter on recent commits).

Just some extra info if you're digging or planning deep...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants