Code Monkey home page Code Monkey logo

dexie-addon-suite-monorepo's People

Contributors

dependabot[bot] avatar pvermeer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dexie-addon-suite-monorepo's Issues

Dexie-RxJs-Addon: Making use of liveQuery

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!

[populate-addon] Compound key as primary key

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.

[dexie-encrypted-addon]: Collection.filter is using encrypted data

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.

Ref type does not work when passing an array type and using Array.every()

Array.every() Does not work for some reason. All other Array methods work as intended.

export type Ref<O extends object, K extends IndexableType, _N = 'Ref'> = NominalT<O> | K;

Ref<Friend[], number[], "Ref">

// @ts-expect-error // Array.every() known issues
hasFriend.hasFriends.every(x => x);

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[];

https://github.com/microsoft/TypeScript/blob/0019c0190df637901606b7fc6b563b482038a14b/lib/lib.es5.d.ts#L1331

Currently I have no idea how to fix this (maybe TypeScript bug?).

Workaround: use the inverted Array.some() to get the same result.

[ASK] Implementation on NextJS 12

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!

DexieDB.ts
image

list-sls.tsx
image

getserversideprops on list-sls.tsx
image

Error
image

Decryption Help

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

Dexie-encrypted-addon: Secret key should no longer be optional

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.

does dexie-encrypted-addon handle keeping the encryption secret key secure/safe?

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.