ModelStatic
ModelStatic<
TInstance
,TFields
> =TInstance
Defined in: types.ts:273
Represents the static side of a model class (the class itself).
Type Parameters
Section titled “Type Parameters”TInstance
Section titled “TInstance”TInstance
extends ModelInstance
<any
>
The type of an instance of this model.
TFields
Section titled “TFields”TFields
extends Record
<string
, FieldDefinition
<unknown
>>
The field definitions for this model.
new ModelStatic(
data
):TInstance
Defined in: types.ts:278
Represents the static side of a model class (the class itself).
Parameters
Section titled “Parameters”InferTableDataFromFields
<TFields
>
Returns
Section titled “Returns”TInstance
Properties
Section titled “Properties”_fields
Section titled “_fields”_fields:
TFields
Defined in: types.ts:280
_options
Section titled “_options”_options:
TableDefineOptions
<TFields
>
Defined in: types.ts:281
_tableName
Section titled “_tableName”_tableName:
string
Defined in: types.ts:279
Methods
Section titled “Methods”create()
Section titled “create()”create(
this
,db
,data
):Promise
<TInstance
>
Defined in: types.ts:285
Parameters
Section titled “Parameters”ModelStatic
<TInstance
, TFields
>
Surreal
CreateData
<TFields
>
Returns
Section titled “Returns”Promise
<TInstance
>
getTableName()
Section titled “getTableName()”getTableName():
string
Defined in: types.ts:284
Returns
Section titled “Returns”string
select()
Section titled “select()”Call Signature
Section titled “Call Signature”select<
QueryOptions
>(this
,db
,options
):Promise
<undefined
|Record
<string
,unknown
>>
Defined in: types.ts:294
Type Parameters
Section titled “Type Parameters”QueryOptions
Section titled “QueryOptions”QueryOptions
extends SelectQueryOptions
<InferTableDataFromFields
<TFields
>>
Parameters
Section titled “Parameters”ModelStatic
<TInstance
, TFields
>
Surreal
options
Section titled “options”QueryOptions
& object
Returns
Section titled “Returns”Promise
<undefined
| Record
<string
, unknown
>>
Call Signature
Section titled “Call Signature”select<
QueryOptions
>(this
,db
,options
):Promise
<Record
<string
,unknown
>[]>
Defined in: types.ts:303
Type Parameters
Section titled “Type Parameters”QueryOptions
Section titled “QueryOptions”QueryOptions
extends SelectQueryOptions
<InferTableDataFromFields
<TFields
>>
Parameters
Section titled “Parameters”ModelStatic
<TInstance
, TFields
>
Surreal
options
Section titled “options”QueryOptions
& object
Returns
Section titled “Returns”Promise
<Record
<string
, unknown
>[]>
Call Signature
Section titled “Call Signature”select<
QueryOptions
>(this
,db
,options
):Promise
<undefined
|TInstance
>
Defined in: types.ts:312
Type Parameters
Section titled “Type Parameters”QueryOptions
Section titled “QueryOptions”QueryOptions
extends SelectQueryOptions
<InferTableDataFromFields
<TFields
>>
Parameters
Section titled “Parameters”ModelStatic
<TInstance
, TFields
>
Surreal
options
Section titled “options”QueryOptions
& object
Returns
Section titled “Returns”Promise
<undefined
| TInstance
>
Call Signature
Section titled “Call Signature”select<
QueryOptions
>(this
,db
,options
):Promise
<TInstance
[]>
Defined in: types.ts:321
Type Parameters
Section titled “Type Parameters”QueryOptions
Section titled “QueryOptions”QueryOptions
extends SelectQueryOptions
<InferTableDataFromFields
<TFields
>>
Parameters
Section titled “Parameters”ModelStatic
<TInstance
, TFields
>
Surreal
options
Section titled “options”QueryOptions
& object
Returns
Section titled “Returns”Promise
<TInstance
[]>
Call Signature
Section titled “Call Signature”select(
this
,db
):Promise
<TInstance
[]>
Defined in: types.ts:330
Parameters
Section titled “Parameters”ModelStatic
<TInstance
, TFields
>
Surreal
Returns
Section titled “Returns”Promise
<TInstance
[]>