techfort / LokiJS

javascript embeddable / in-memory database
http:/techfort.github.io/LokiJS
MIT License
6.73k stars 482 forks source link

Loki IndexedDb adapter is not exported #851

Closed ajmas closed 2 years ago

ajmas commented 4 years ago

Looking at src/lokijs.js I see that the Loki IndexedDb adapter is not exported. At the moment in ES6 code I can do:

import Loki, { LokiLocalStorageAdapter } from 'lokijs';

but I can't do the same for LokiIndexedDbAdapter. This would need a change so that in src/lokijs.js:

  Loki.LokiMemoryAdapter = LokiMemoryAdapter;
  Loki.LokiPartitioningAdapter = LokiPartitioningAdapter;
  Loki.LokiLocalStorageAdapter = LokiLocalStorageAdapter;
  Loki.LokiIndexedDbAdapter = LokiIndexedDbAdapter;
  Loki.LokiFsAdapter = LokiFsAdapter;

Though given the code structure, that would mean bring in the code from src/loki-indexed-adapter.js. One question here, is whether there is any reason why there is no importing of functionality via a require?

ajmas commented 4 years ago

Actually it turns out that we can do this instead:

import LokidIndexedAdapter from 'lokijs/src/loki-indexed-adapter';

At the same time it would be curious if there is interest to moving to ES6 coding approaches?

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

thomaschampagne commented 3 years ago

+1

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

patarapolw commented 3 years ago

+1

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.