Open shayded-exe opened 2 years ago
I have the same question. I just found out that https://github.com/techfort/LokiJS/pull/896 - a pull from March I could really use - is still not released.
Pretty sure it's dead. Was testing this out, and finally got around to wanting a list of distinct values. There's quite a few issues that have been automatically marked as stale, labeled as wontfix, and closed over the years.
Is it really dead? No, it's mature and stable, and has received a number of performance upgrades over the past 3 years… regardless, LokiJS lives on as part of https://github.com/Nozbe/WatermelonDB so I have a strong interest in maintaining it to the extent necessary for WatermelonDB, can't really abandon it...
Even your latest performance improvements are a good example. #899 After a few months the bot tried to mark it as wontfix and you had to ping techfort to come look at their project. And even though the improvements were merged, they still haven't been released a year later. Npm still uses version 1.5.12 which was released almost 2 years ago now.
There's a long list of issues over the past couple years that have been automatically marked as wontfix and closed because the owner isn't even checking.
I'm not trying bash anyone, but people looking to use lokijs in their projects need to understand that no one is really supporting this anymore, and the only reason it looks as clean as it does is because of stalebot.
I ended up forking the repo for my own use cases, but if anyone finds it helpful you can take a look here
https://lokijs.org redirects to https://rxdb.info/
So probably.
@cfu288 is yours compatible with rxdb? sounds like you've made another way to use OPFS via your tool in rxdb
@aehlke Frankly I haven't tried to write a SylvieJS adapter for RxDB, but theoretically it should be as simple as swapping the adapter reference from LokiJS to SylvieJS in RxStorageLoki
as I tried to keep the API backwards compatible.
In my personal project with RxDB, I'm still using the LokiJS RxDB storage via getRxStorageLoki()
with my new CryptedIndededDBAdapter written for SylvieJS but its backwards compatible with LokiJS. The OPFS adapter was also written to be backwards compatible with LokiJS. I haven't tested my OPFS adapter in a prod environment, but its passing unit tests.
https://lokijs.org/ redirects to https://rxdb.info/
@2brownc Just for context, I bought the domain from some dude in spain. RxDB is not affiliated with LokiJS. I do not know anything more then you do.
@cfu288 Yes it sounds doable and it should be pretty easy to write an OPFS adapter for lokijs and then use that with RxDB. LokiJS only stores big strings and putting them into virtual OPFS files shouldnt be that hard.
Notice that I have run fuzzing tests over the RxDB storages where I generated random writes and queries and then check for query result correctness. LokiJS fails on so many queries and often produces wrong results. So @cfu288 if you want to further maintain your fork, maybe you should also run these fuzzing scripts and fix the broken queries. In the future we could also fully replace the lokijs dependency of RxDB with your SylvieJS fork and then remove the warning from the LokiJS RxStorage docs.
@pubkey i've actually already written the OPFS adapter for LokiJS, it was a simple but naïve implementation.
The SylvieJS fork was really primarily for my personal internal usage (used in Mere Medical), but I'll take a stab and see how well it integrates with RxDB and see if I can get it to pass your fuzz tests.
@pubkey @cfu288 Just wanted to say that it would be awesome to get SylvieJS and RxDB married officially! It would be great to have an free and open source alternative for RxDB on the node side, and the Premium Plugin would still be interesting for performance optimization by using adapters directly instead of adding SylvieJS as an additional layer.
@Connum Hey unfortunately I haven't had any bandwidth to test the RxDB integration and fix the RxDB fuzz tests. SylvieJS is looking for maintainers though!
@pubkey
maybe you should also run these fuzzing scripts and fix the broken queries
How would I go about running those tests specifically with SylvieJS?
@cfu288 thanks for the quick reply. My own time is limited as well and I've neglected other open source projects more than I'd like... But I'd be interested in running those fuzzing tests and see whether I can fix them as PRs in SylvieJS
@pubkey @cfu288 I forked and made two branches on your projects: https://github.com/Connum/SylvieJS/tree/rxdb-integration https://github.com/Connum/rxdb/tree/feature/sylviejs
I ported the loki storage adapter to sylvie and made sure that everything is running as it was before. It should now be easier to fix outstanding compatibility issues.
I ended up forking the repo for my own use cases, but if anyone finds it helpful you can take a look here
@cfu288 Thank you SO MUCH for doing this! I was trying to move my project that depended on LokiJS from create-react-app to Vite, but for some reason, the IndexedDB adapter just would not save when I used Vite. (Must be some issue wtih something breaking when bundling the old-style modules.) Yours works great with the ES6 codebase. I'm so grateful to have the fork!
@Connum @pubkey @cfu288 What's the performance comparison between LokiJS and RxDB? I've been using LokiJS for regex searching through a 18k document database and it's blazing fast... I also don't need to continually update the DB, I just need to let the user download a new collection every once and awhile and be able to search FAST, locally on their device. I was wondering if there's anything else out there comparable for speed for that. Until then I'm gonna keep using @cfu288 's fork, SylvieJS.
I'm considering using this for a professional project as a storage adapter for rxdb, as it seems to be the best option for a local-only, file-based db.
Are there any future plans to support this project, and is there a replacement out there if not?
Thanks