Class: VectorQueryBuilder
Defined in: batteries/vector/builder.ts:246
The where-clause surface of the query builder, factored out so a grouping callback can be handed a builder that only exposes filter methods (not near*/select/limit or the terminals).
Chained .where() ANDs; the first .orWhere() snapshots the accumulated AND-list into the first branch of an OR (knex semantics). Any of the where-methods also accepts a FilterCallback to open a nested group, letting AND and OR mix to any depth.
Extends
Implements
PromiseLike<VectorMatch[]>
Constructors
Constructor
new VectorQueryBuilder(
sink: PlanSink,
collection: string,
defaultTopK: number): VectorQueryBuilder;Defined in: batteries/vector/builder.ts:256
Parameters
| Parameter | Type |
|---|---|
sink | PlanSink |
collection | string |
defaultTopK | number |
Returns
VectorQueryBuilder
Overrides
Methods
andWhere()
Call Signature
andWhere(cb: FilterCallback): this;Defined in: batteries/vector/builder.ts:113
Parameters
| Parameter | Type |
|---|---|
cb | FilterCallback |
Returns
this
Inherited from
Call Signature
andWhere(
a: string,
b?: unknown,
c?: unknown): this;Defined in: batteries/vector/builder.ts:114
Parameters
| Parameter | Type |
|---|---|
a | string |
b? | unknown |
c? | unknown |
Returns
this
Inherited from
Call Signature
andWhere(obj: Record<string, unknown>): this;Defined in: batteries/vector/builder.ts:115
Parameters
| Parameter | Type |
|---|---|
obj | Record<string, unknown> |
Returns
this
Inherited from
consistency()
consistency(mode: VectorConsistency): this;Defined in: batteries/vector/builder.ts:349
Per-operation read-after-write override for the terminal .upsert() / .delete(). Universal across adapters: strongly-consistent backends ignore it (no-op), so a chain written for an eventually-consistent backend keeps working verbatim when the adapter is swapped. Precedence: this > the store's consistency option > the adapter's declared capabilities.consistency.default. See VectorConsistency.
Parameters
| Parameter | Type |
|---|---|
mode | VectorConsistency |
Returns
this
delete()
delete(): Promise<void>;Defined in: batteries/vector/builder.ts:391
Returns
Promise<void>
limit()
limit(n: number): this;Defined in: batteries/vector/builder.ts:332
Parameters
| Parameter | Type |
|---|---|
n | number |
Returns
this
nearId()
nearId(id: string): this;Defined in: batteries/vector/builder.ts:279
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
this
nearText()
nearText(text: string): this;Defined in: batteries/vector/builder.ts:271
Parameters
| Parameter | Type |
|---|---|
text | string |
Returns
this
nearVector()
nearVector(vector: number[]): this;Defined in: batteries/vector/builder.ts:263
Parameters
| Parameter | Type |
|---|---|
vector | number[] |
Returns
this
offset()
offset(n: number): this;Defined in: batteries/vector/builder.ts:337
Parameters
| Parameter | Type |
|---|---|
n | number |
Returns
this
orWhere()
Call Signature
orWhere(cb: FilterCallback): this;Defined in: batteries/vector/builder.ts:129
Parameters
| Parameter | Type |
|---|---|
cb | FilterCallback |
Returns
this
Inherited from
Call Signature
orWhere(field: string, value: unknown): this;Defined in: batteries/vector/builder.ts:130
Parameters
| Parameter | Type |
|---|---|
field | string |
value | unknown |
Returns
this
Inherited from
Call Signature
orWhere(
field: string,
op: FilterOperator,
value: unknown): this;Defined in: batteries/vector/builder.ts:131
Parameters
| Parameter | Type |
|---|---|
field | string |
op | FilterOperator |
value | unknown |
Returns
this
Inherited from
orWhereNot()
Call Signature
orWhereNot(cb: FilterCallback): this;Defined in: batteries/vector/builder.ts:159
Parameters
| Parameter | Type |
|---|---|
cb | FilterCallback |
Returns
this
Inherited from
Call Signature
orWhereNot(field: string, value: unknown): this;Defined in: batteries/vector/builder.ts:160
Parameters
| Parameter | Type |
|---|---|
field | string |
value | unknown |
Returns
this
Inherited from
select()
select(...args: SelectArg[]): this;Defined in: batteries/vector/builder.ts:287
Parameters
| Parameter | Type |
|---|---|
...args | SelectArg[] |
Returns
this
then()
then<TR1, TR2>(onfulfilled?:
| ((value: VectorMatch[]) => TR1 | PromiseLike<TR1>)
| null, onrejected?: ((reason: unknown) => TR2 | PromiseLike<TR2>) | null): PromiseLike<TR1 | TR2>;Defined in: batteries/vector/builder.ts:354
Attaches callbacks for the resolution and/or rejection of the Promise.
Type Parameters
| Type Parameter | Default type |
|---|---|
TR1 | VectorMatch[] |
TR2 | never |
Parameters
| Parameter | Type | Description |
|---|---|---|
onfulfilled? | | ((value: VectorMatch[]) => TR1 | PromiseLike<TR1>) | null | The callback to execute when the Promise is resolved. |
onrejected? | ((reason: unknown) => TR2 | PromiseLike<TR2>) | null | The callback to execute when the Promise is rejected. |
Returns
PromiseLike<TR1 | TR2>
A Promise for the completion of which ever callback is executed.
Implementation of
PromiseLike.then;upsert()
upsert(records: VectorRecord[]): Promise<void>;Defined in: batteries/vector/builder.ts:382
Parameters
| Parameter | Type |
|---|---|
records | VectorRecord[] |
Returns
Promise<void>
where()
Call Signature
where(cb: FilterCallback): this;Defined in: batteries/vector/builder.ts:85
Parameters
| Parameter | Type |
|---|---|
cb | FilterCallback |
Returns
this
Inherited from
Call Signature
where(
a: string,
b?: unknown,
c?: unknown): this;Defined in: batteries/vector/builder.ts:86
Parameters
| Parameter | Type |
|---|---|
a | string |
b? | unknown |
c? | unknown |
Returns
this
Inherited from
Call Signature
where(obj: Record<string, unknown>): this;Defined in: batteries/vector/builder.ts:87
Parameters
| Parameter | Type |
|---|---|
obj | Record<string, unknown> |
Returns
this
Inherited from
whereExists()
whereExists(field: string): this;Defined in: batteries/vector/builder.ts:184
Parameters
| Parameter | Type |
|---|---|
field | string |
Returns
this
Inherited from
whereIn()
whereIn(field: string, values: unknown[]): this;Defined in: batteries/vector/builder.ts:172
Parameters
| Parameter | Type |
|---|---|
field | string |
values | unknown[] |
Returns
this
Inherited from
whereNot()
Call Signature
whereNot(cb: FilterCallback): this;Defined in: batteries/vector/builder.ts:146
Parameters
| Parameter | Type |
|---|---|
cb | FilterCallback |
Returns
this
Inherited from
Call Signature
whereNot(field: string, value: unknown): this;Defined in: batteries/vector/builder.ts:147
Parameters
| Parameter | Type |
|---|---|
field | string |
value | unknown |
Returns
this
Inherited from
whereNotIn()
whereNotIn(field: string, values: unknown[]): this;Defined in: batteries/vector/builder.ts:176
Parameters
| Parameter | Type |
|---|---|
field | string |
values | unknown[] |
Returns
this
Inherited from
whereNull()
whereNull(field: string): this;Defined in: batteries/vector/builder.ts:180
Parameters
| Parameter | Type |
|---|---|
field | string |
Returns
this
Inherited from
whereRaw()
Call Signature
whereRaw(sql: string, bindings?: unknown[]): this;Defined in: batteries/vector/builder.ts:188
Parameters
| Parameter | Type |
|---|---|
sql | string |
bindings? | unknown[] |
Returns
this
Inherited from
Call Signature
whereRaw(rawObj: {
$bindings?: unknown[];
$dialect: string;
$raw: unknown;
}): this;Defined in: batteries/vector/builder.ts:189
Parameters
| Parameter | Type |
|---|---|
rawObj | { $bindings?: unknown[]; $dialect: string; $raw: unknown; } |
rawObj.$bindings? | unknown[] |
rawObj.$dialect | string |
rawObj.$raw | unknown |
Returns
this