pvermeer / dexie-addon-suite-monorepo Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hello dexie addon suite creators! Thanks a bunch for these addons.
I was running into a small performance problem related to Dexie-RxJs-Addon. The performance problem is with Dexie.Observable, which creates a couple of meta tables(_changes, _intercomm, _syncNodes, _uncommitedChanges) to persist and sychronize changes. They write about this issue in their documentation (the top section with bold https://dexie.org/docs/Observable/Dexie.Observable).
They have since then made the switch to use liveQuery() because the old way was doing much more than needed and also in order to optimize storage and performance. Could the dexie-rxjs-addon suite also not make use of liveQuery for the same reasons? From what I can tell, the liveQuery() returns a Dexie.Observable which does not allow typical rxjs operators like pipe'ing. But I believe we could wrap the liveQuery in an rxjs from() which should turn the dexie.observable into a rxjs observable.
I was just curious if you had any thoughts in this area and if you maybe see a potential upgrade aswell?
Appreciate the addon a bunch, have a nice day!
Hello Dexie expertes! Thank you for the sweet suite of addons!
As far as I understood, Dexie will treat the first field in the table definition as the primary key. However, in all examples for the populate addon, seems like the foreign key, must be mentioned before it is being used. i.e elem_id => elements.id, [elem_id+page_name]
So what if my primary key is combination of two keys [elem_id+page_name]
, will this work [elem_id+page_name], elem_id => elements.id
?
I tried it out. It did not give errors on creating the database. Did not get to the whole flow yet which will do the CRUD operations, but wanted to double check in case I am not on the right path.
Hello, and thanks for the great dexie addons.
While using the encryption addon I found that when I try to filter by encrypted column, the data is not derypted.
It gets decrypted after I call toArray
or sortBy
.
Here is an example: https://codesandbox.io/s/smoosh-frost-x6fhzf?file=/src/dbActions.ts:314-483
Click INSERT, and then SELECT - it should render 2 records, but it does not. Check the console, the name
and shoeSize
are encoded.
db.friends
.filter((f) => {
console.log(f); // name and shoeSize are encoded
return !!f.shoeSize && f.shoeSize > 41;
})
.sortBy("name");
I can filter the data after sortBy
, but performance wise it is better to first apply the filters and then sort the data.
Is there a workaround? Am I missing something?
I tried dexie-encrypted
, and it decodes the data earlier, so inside filter()
the data is already decoded.
Unfortunately, dexie-encrypted
has other issues and it is no longer maintained.
Our use case requires filtering and sorting large amounts of encrypted data, so such a feature would be great.
If code changes are required, I am willing to help, but will need assistance.
Array.every()
Does not work for some reason. All other Array methods work as intended.
Ref<Friend[], number[], "Ref">
This expression is not callable.
Each member of the union type '{ <S extends number>(predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; } | { ...; }' has signatures, but none of those signatures are compatible with each other. ts(2349)
Disabling this overload type in lib.es5.d.ts
fixes the issue:
every<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): this is S[];
Currently I have no idea how to fix this (maybe TypeScript bug?).
Workaround: use the inverted Array.some()
to get the same result.
Hi,
Thanks for your effort on building this amazing lib!
I wanted to ask about the following issue in the repo.
I have implemented Dexie using Next 12 smoothly, and I would like to add encrypt/decrypt capability using this lib, and it works amazingly. However, when I tried to reload the page, unfortunately an error occurred. The error said that "Could not decrypt message". I have already checked the secret key used, and I see that the key is consistent.
Would appreciate any insights or guidance on this matter. Thank you!
Hi team,
Great addon. thanks!
I'm just trying to understand how to decrypt the data on reading.
I have been suing your html example and can see the data is encrypted
Thanks
See #29
Secret keys should no longer be optional. This can lead to a lot of confusion when a key is generated.
Also look at the error generated when failing to decrypt. Perhaps add more info like n documents could not be decrypted because key has changed and the database should be deleted.
Hello, First thanks for this great library and its addon.
There is something that is not clear for me about the secret key and encryption, does dexie-encrypted-addon handle keeping the encryption secret key secure/safe?
I saw in the documentation that you are doing this:
// Generate a random key const secret = Encryption.createRandomEncryptionKey();
Is doing the encryption this way will be safe/secure? or can any one inspect that secret key and use it to encrypt the database?
I'm using this library with Next.js, thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.