js-bao-wss-client / defineModelSchema
Function: defineModelSchema()
defineModelSchema<
TFields>(input):DefinedModelSchema<TFields>
Define a model's schema: its fields, and optionally its compound unique constraints, relationships and class name.
A unique constraint applies to scalar fields only. unique: true on a stringset field, or a uniqueConstraints entry naming a stringset field, is refused here: no writer can build that key consistently, so the platform cannot honor it.
Type Parameters
TFields
TFields extends Record<string, FieldOptions>
Parameters
input
DefineModelSchemaInput<TFields>
Returns
DefinedModelSchema<TFields>
Throws
UniqueStringsetError when the schema declares a unique constraint over a stringset field. The message names the model, the field (and the constraint, for a compound one) and the reason.