primaryKey
readonly primaryKey: string
Defined in: ridb_core.d.ts:568
The primary key of the schema.
Defined in: ridb_core.d.ts:545
Represents a schema, including its definition and related methods. You may be trying to build a storage, in any other can u won't need access tho this class. Check this example
typescript12345class MyStorage extends <T extends SchemaTypeRecord> extends BaseStorage<T> {example() {const schema: Schema<any> = this.getSchema("mySchema")}}
You alwayswill have access to getSchema through the Storage class.
T
extends SchemaType
The schema type.
new Schema<T>(): Schema<T>
Schema
<T
>
readonly optional encrypted: Extract<keyof T, string>[]
Defined in: ridb_core.d.ts:586
An optional array of encrypted fields.
readonly optional indexes: Extract<keyof T, string>[]
Defined in: ridb_core.d.ts:581
An optional array of indexes.
readonly primaryKey: string
Defined in: ridb_core.d.ts:568
The primary key of the schema.
readonly properties: { [K in string | number | symbol as T["properties"][K]["required"] extends false | (T["properties"][K]["default"] extends undefined ? true : false) ? K : never]?: T["properties"][K] } & { [K in string | number | symbol as T["properties"][K]["required"] extends false ? never : K]: T["properties"][K] }
Defined in: ridb_core.d.ts:591
The properties defined in the schema.
schema: Schema<T>
Defined in: ridb_core.d.ts:549
The schema definition.
readonly type: SchemaFieldType
Defined in: ridb_core.d.ts:573
The type of the schema.
readonly version: number
Defined in: ridb_core.d.ts:563
The version of the schema.
toJSON(): SchemaType
Defined in: ridb_core.d.ts:601
Converts the schema to a JSON representation.
The JSON representation of the schema.
validate(document): boolean
Defined in: ridb_core.d.ts:603
Doc
<Schema
<T
>>
boolean
static create<TS>(definition): Schema<TS>
Defined in: ridb_core.d.ts:558
Creates a new Schema
instance from the provided definition.
TS
extends SchemaType
The schema type.
TS
Schema
<TS
>
The created Schema
instance.