Class: VectorSchemaBuilder
Defined in: src/batteries/vector/schema.ts:125
Knex-style schema facade exposing collection DDL (create/drop/rename/has) over a SchemaExecutor. Returned by a vector store's schema() accessor.
Constructors
Constructor
new VectorSchemaBuilder(executor: SchemaExecutor): VectorSchemaBuilder;Defined in: src/batteries/vector/schema.ts:131
Parameters
| Parameter | Type | Description |
|---|---|---|
executor | SchemaExecutor | The adapter-backed executor the DDL calls are drained into. |
Returns
VectorSchemaBuilder
Methods
createCollection()
createCollection(collection: string, cb: (c: CollectionBuilder) => void): Promise<void>;Defined in: src/batteries/vector/schema.ts:136
Create a collection, defining it via the cb builder. Errors if it already exists.
Parameters
| Parameter | Type |
|---|---|
collection | string |
cb | (c: CollectionBuilder) => void |
Returns
Promise<void>
createCollectionIfNotExists()
createCollectionIfNotExists(collection: string, cb: (c: CollectionBuilder) => void): Promise<void>;Defined in: src/batteries/vector/schema.ts:144
Create a collection only if absent; a no-op if it already exists.
Parameters
| Parameter | Type |
|---|---|
collection | string |
cb | (c: CollectionBuilder) => void |
Returns
Promise<void>
dropCollection()
dropCollection(collection: string): Promise<void>;Defined in: src/batteries/vector/schema.ts:155
Drop a collection. Errors if it does not exist.
Parameters
| Parameter | Type |
|---|---|
collection | string |
Returns
Promise<void>
dropCollectionIfExists()
dropCollectionIfExists(collection: string): Promise<void>;Defined in: src/batteries/vector/schema.ts:160
Drop a collection only if present; a no-op if it does not exist.
Parameters
| Parameter | Type |
|---|---|
collection | string |
Returns
Promise<void>
hasCollection()
hasCollection(collection: string): Promise<boolean>;Defined in: src/batteries/vector/schema.ts:165
Resolve true if the collection exists.
Parameters
| Parameter | Type |
|---|---|
collection | string |
Returns
Promise<boolean>
renameCollection()
renameCollection(from: string, to: string): Promise<void>;Defined in: src/batteries/vector/schema.ts:170
Rename a collection from from to to.
Parameters
| Parameter | Type |
|---|---|
from | string |
to | string |
Returns
Promise<void>