ebEntity<
TB
>(entityType?
:TB
): {equals
: (eb
:ExpressionBuilder
<LixDatabaseSchema
,TB
>) =>ExpressionWrapper
<LixDatabaseSchema
,TB
,SqlBool
>;hasLabel
: (eb
:ExpressionBuilder
<LixDatabaseSchema
,TB
>) =>ExpressionWrapper
<LixDatabaseSchema
,TB
,SqlBool
>;in
: (eb
:ExpressionBuilder
<LixDatabaseSchema
,TB
>) =>ExpressionWrapper
<LixDatabaseSchema
,TB
,SqlBool
>; }
Entity Expression Builder - provides fluent API for entity operations in queries.
This allows for more readable query syntax like: .where(ebEntity("file").hasLabel({ name: "important" })) .where(ebEntity("state").equals(userAccount)) .where(ebEntity().in(entities)) // When context is unambiguous (no joins)
Type Parameter | Default type |
---|---|
TB extends "key_value" | "key_value_all" | "key_value_history" | "account" | "account_all" | "account_history" | "change_set" | "change_set_all" | "change_set_history" | "change_set_element" | "change_set_element_all" | "change_set_element_history" | "change_set_label" | "change_set_label_all" | "change_set_label_history" | "change_author" | "change_author_all" | "change_author_history" | "file" | "file_all" | "file_history" | "label" | "label_all" | "label_history" | "state" | "entity_label" | "entity_label_all" | "entity_label_history" | "entity_thread" | "entity_thread_all" | "entity_thread_history" | "version" | "stored_schema" | "stored_schema_all" | "stored_schema_history" | "log" | "log_all" | "log_history" | "thread" | "thread_all" | "thread_history" | "thread_comment" | "thread_comment_all" | "thread_comment_history" | "version_all" | "version_history" | "commit" | "commit_all" | "commit_history" | "commit_edge" | "commit_edge_all" | "commit_edge_history" | "active_account" | "active_version" | "state_all" | "state_with_tombstones" | "state_history" | "change" | "key_value" | "key_value_all" | "key_value_history" | "account" | "account_all" | "account_history" | "change_set" | "change_set_all" | "change_set_history" | "change_set_element" | "change_set_element_all" | "change_set_element_history" | "change_set_label" | "change_set_label_all" | "change_set_label_history" | "change_author" | "change_author_all" | "change_author_history" | "file" | "file_all" | "file_history" | "label" | "label_all" | "label_history" | "state" | "entity_label" | "entity_label_all" | "entity_label_history" | "entity_thread" | "entity_thread_all" | "entity_thread_history" | "version" | "stored_schema" | "stored_schema_all" | "stored_schema_history" | "log" | "log_all" | "log_history" | "thread" | "thread_all" | "thread_history" | "thread_comment" | "thread_comment_all" | "thread_comment_history" | "version_all" | "version_history" | "commit" | "commit_all" | "commit_history" | "commit_edge" | "commit_edge_all" | "commit_edge_history" | "active_account" | "active_version" | "state_all" | "state_with_tombstones" | "state_history" | "change" |
Parameter | Type | Description |
---|---|---|
entityType? | TB | The type of entity table being queried (e.g., "file", "account", "thread"). Optional when the context is unambiguous (e.g., single table queries with no joins). |
equals(
entity
:LixEntityCanonical
|LixEntity
): (eb
:ExpressionBuilder
<LixDatabaseSchema
,TB
>) =>ExpressionWrapper
<LixDatabaseSchema
,TB
,SqlBool
>
Creates a filter that matches entities equal to the specified entity.
Parameter | Type | Description |
---|---|---|
entity | LixEntityCanonical | LixEntity | The entity to match against (must have entity_id, schema_key, file_id) |
Expression wrapper for use in WHERE clauses
(
eb
:ExpressionBuilder
<LixDatabaseSchema
,TB
>):ExpressionWrapper
<LixDatabaseSchema
,TB
,SqlBool
>
Parameter | Type |
---|---|
eb | ExpressionBuilder <LixDatabaseSchema , TB > |
ExpressionWrapper
<LixDatabaseSchema
, TB
, SqlBool
>
hasLabel(
label
: {id
:string
;name?
:string
; } | {id?
:string
;name
:string
; }): (eb
:ExpressionBuilder
<LixDatabaseSchema
,TB
>) =>ExpressionWrapper
<LixDatabaseSchema
,TB
,SqlBool
>
Creates a filter that matches entities having the specified label.
Parameter | Type | Description |
---|---|---|
label | { id : string ; name? : string ; } | { id? : string ; name : string ; } | The label to filter by (either { name: "..." } or { id: "..." }) |
Expression wrapper for use in WHERE clauses
(
eb
:ExpressionBuilder
<LixDatabaseSchema
,TB
>):ExpressionWrapper
<LixDatabaseSchema
,TB
,SqlBool
>
Parameter | Type |
---|---|
eb | ExpressionBuilder <LixDatabaseSchema , TB > |
ExpressionWrapper
<LixDatabaseSchema
, TB
, SqlBool
>
in(
entities
: ({entity_id
:string
;file_id
:string
;schema_key
:string
; } | {lixcol_entity_id
:string
;lixcol_file_id
:string
;lixcol_schema_key
:string
; })[]): (eb
:ExpressionBuilder
<LixDatabaseSchema
,TB
>) =>ExpressionWrapper
<LixDatabaseSchema
,TB
,SqlBool
>
Creates a filter that matches entities in the specified list.
Parameter | Type | Description |
---|---|---|
entities | ({ entity_id : string ; file_id : string ; schema_key : string ; } | { lixcol_entity_id : string ; lixcol_file_id : string ; lixcol_schema_key : string ; })[] | Array of entities to match against |
Expression wrapper for use in WHERE clauses
(
eb
:ExpressionBuilder
<LixDatabaseSchema
,TB
>):ExpressionWrapper
<LixDatabaseSchema
,TB
,SqlBool
>
Parameter | Type |
---|---|
eb | ExpressionBuilder <LixDatabaseSchema , TB > |
ExpressionWrapper
<LixDatabaseSchema
, TB
, SqlBool
>