Skip to content

Conversation

Hywan
Copy link
Member

@Hywan Hywan commented Feb 16, 2023

This patch allows an OlmMachine to use a different store than Sled, like SQLite.

A new enum is introduced: StoreType with 2 variants: Sled (the default), and Sqlite.

The OlmMachine.initialize constructor now takes a new optional store_type: Option<StoreType> argument. If no value is passed, the default StoreType variant will be used (as mentioned: StoreType.Sled).

The code has been rewritten a little bit to make the type system happy without introducing too much type indirections.

This patch finally adds a parameterized test that exhaustively tests: no store type, Sled and Sqlite.


@Hywan Hywan force-pushed the feat-crypto-nodejs-sqlite branch 2 times, most recently from 78b4c80 to d172d8a Compare February 16, 2023 15:21
@Hywan Hywan force-pushed the feat-crypto-nodejs-sqlite branch from d172d8a to b8d2370 Compare February 16, 2023 15:23
…re type.

This patch allows an `OlmMachine` to use a different store than Sled, like SQLite.

A new enum is introduced: `StoreType` which 2 variants: `Sled` (the default), and `Sqlite`.

The `OlmMachine.initialize` constructor now takes a new optional `store_type:
Option<StoreType>` argument. If no value is passed, the default `StoreType`
variant will be used (as mentioned: `StoreType.Sled`).

The code has been rewritten a little bit to make the type system happy without
introducing too much type indirections.

This patch finally adds a parameterized tests that exhaustively test: no store
type, `Sled` and `Sqlite`.
@Hywan Hywan force-pushed the feat-crypto-nodejs-sqlite branch from b8d2370 to d600af7 Compare February 16, 2023 15:26
@Hywan Hywan marked this pull request as ready for review February 16, 2023 15:26
@Hywan Hywan requested a review from poljar February 20, 2023 18:23
Copy link
Contributor

@poljar poljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support initalising a sqlite store from the js-sdk bindings

2 participants