Skip to content

DbSchemaFromInputSchema

DbSchemaFromInputSchema<TSchemaInput>: TSchemaInput extends ReadonlyArray<TableDefinition<any, any>> ? { [K in TSchemaInput[number] as K["name"]]: K } : TSchemaInput extends Record<string, TableDefinition<any, any>> ? { [K in keyof TSchemaInput as TSchemaInput[K]["name"]]: TSchemaInput[K] } : never

Defined in: packages/@livestore/common/dist/schema/state/sqlite/db-schema/dsl/mod.d.ts:17

In case of …

  • array: we use the table name of each array item (= table definition) as the object key
  • object: we discard the keys of the input object and use the table name of each object value (= table definition) as the new object key

Type Parameters

TSchemaInput extends DbSchemaInput