Skip to content

Commit 0a141de

Browse files
NicolappsConvex, Inc.
authored andcommitted
Fix CLI TypeScript types missing vector indexes (#41922)
GitOrigin-RevId: d446fe6bb34c0cf0876426732736f69b876ee7b0
1 parent 44695a1 commit 0a141de

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

crates/local_backend/src/schema.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,17 @@ struct BackfillResponse {
7474
state: String,
7575
}
7676

77+
// When updating this, please keep `IndexMetadata`
78+
// in `npm-packages/convex/src/cli/lib/indexes.ts` in sync
7779
#[derive(Serialize)]
7880
#[serde(rename_all = "camelCase")]
7981
pub struct IndexMetadataResponse {
8082
table: String,
8183
name: String,
82-
// Either an array of fields (`string[]`) for a database index or an object of
83-
// `{ searchField: string, filterFields: string }` for a search index.
84+
// Either:
85+
// - an array of fields (`string[]`) for a database index
86+
// - `{ searchField: string, filterFields: string[] }` for a search index
87+
// - `{ dimensions: number, vectorField: string, filterFields: string[] }` for a vector index
8488
fields: JsonValue,
8589
backfill: BackfillResponse,
8690
staged: bool,

npm-packages/convex/src/cli/lib/indexes.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ type IndexMetadata = {
2424
| {
2525
searchField: string;
2626
filterFields: string[];
27+
}
28+
| {
29+
dimensions: number;
30+
vectorField: string;
31+
filterFields: string[];
2732
};
2833
backfill: {
2934
state: "in_progress" | "done";

0 commit comments

Comments
 (0)