tinybase icon indicating copy to clipboard operation
tinybase copied to clipboard

Allow dynamic columns

Open skorphil opened this issue 10 months ago • 1 comments

Is your feature request related to a problem? Please describe. I have data structure with dynamic properties (some of them are constant, but others can be anything) Currently tinyBase do not support this:

export const persistentStateStore = createStore().setTablesSchema(tinyBasePersistentStoreSchema);

persistentStateStore.setTables({ appState: {currentJournalDirectory: { newProperty: "test", // Object literal may only specify known properties, and 'test' does not exist in type selectedCurrency: "usd" }} })

Describe the solution you'd like Allow dynamic columns

skorphil avatar Mar 26 '25 09:03 skorphil

By default, all TinyBase cells/columns are dynamic. You can add any to any row at runtime.

In your case you are creating a schema, which then disallows arbitrary columns. I would recommend you have one store with a schema (if you want constrained columns) and another with no schema (which will let you write what you like).

Does that help?

jamesgpearce avatar Mar 27 '25 17:03 jamesgpearce