Documentation / @warp-drive/schema-record / fromIdentity
Call Signature
function fromIdentity(
record,
options,
key): string;
Defined in: schema.ts:114
A derivation that computes its value from the record's identity.
It can be used via a derived field definition like:
{
kind: 'derived',
name: 'id',
type: '@identity',
options: { key: 'id' }
}
Valid keys are 'id'
, 'lid'
, 'type'
, and '^'
.
^
returns the entire identifier object.
Parameters
record
options
{ key
: "lid"
; } | { key
: "type"
; }
key
string
Returns
string
Call Signature
function fromIdentity(
record,
options,
key): null | string;
Defined in: schema.ts:115
A derivation that computes its value from the record's identity.
It can be used via a derived field definition like:
{
kind: 'derived',
name: 'id',
type: '@identity',
options: { key: 'id' }
}
Valid keys are 'id'
, 'lid'
, 'type'
, and '^'
.
^
returns the entire identifier object.
Parameters
record
options
key
"id"
key
string
Returns
null
| string
Call Signature
function fromIdentity(
record,
options,
key): StableRecordIdentifier;
Defined in: schema.ts:116
A derivation that computes its value from the record's identity.
It can be used via a derived field definition like:
{
kind: 'derived',
name: 'id',
type: '@identity',
options: { key: 'id' }
}
Valid keys are 'id'
, 'lid'
, 'type'
, and '^'
.
^
returns the entire identifier object.
Parameters
record
options
key
"^"
key
string
Returns
Call Signature
function fromIdentity(
record,
options,
key): asserts options;
Defined in: schema.ts:117
A derivation that computes its value from the record's identity.
It can be used via a derived field definition like:
{
kind: 'derived',
name: 'id',
type: '@identity',
options: { key: 'id' }
}
Valid keys are 'id'
, 'lid'
, 'type'
, and '^'
.
^
returns the entire identifier object.
Parameters
record
options
null
key
string
Returns
asserts options