Skip to content

Feature request: Persisting subset of Values #279

@dheerajvs

Description

@dheerajvs

First, TinyBase is awesome, thank you!

Is your feature request related to a problem? Please describe.
In my React Native app, there are some Values that I need to persist and others which must not be persisted (UI-only state).

Describe the solution you'd like
Currently, the store only allows loading subsets of tables by specifying a condition. To provide this feature parity for Values, could we allow an "in-clause" in the DpcTabularValues config? Something like:

  values: {
    tableName: 'my_tinybase_values',
    load: {valuesIn: ['employees', 'open']},
    save: {valuesIn: ['employees']},
  }

Describe alternatives you've considered
The obvious alternative is to create another store for non-persistent values. However, one problem with that approach for me is that the @dev-plugins/tinybase Expo plugin in the React Native app does not support displaying multiple stores at once in the Inspector.

Another alternative is to use a Table with a singleton row to use non-persistent values.

Additional context
I'm using the ExpoSqlitePersister to be specific.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions