Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5278437
add: vectordb sdk support.
ItzNotABug Feb 11, 2026
db8916d
Merge branch 'feat-documentsdb' into feat-vectordb
premtsd-code Mar 16, 2026
f38a9bc
fix: rename vectordb to vectorsdb for naming consistency.
premtsd-code Mar 16, 2026
61c1e82
fix: vectorsdb collection pages use correct SDK endpoints
premtsd-code Mar 18, 2026
218be14
fix: guard mock suggestions for vectorsdb, optimize fold scan
premtsd-code Mar 18, 2026
5d0e4ff
vectorsdb collection page and empty state bugs
premtsd-code Mar 20, 2026
a1ec42b
merge feat-documentsdb and fix SDK type errors
premtsd-code Mar 20, 2026
1bfe064
(fix): vectorsdb review fixes — index creation, SDK embeddings, fold …
premtsd-code Mar 21, 2026
8accb15
(chore): update console SDK to 04899af with rebuilt types
premtsd-code Mar 21, 2026
6df70db
Merge remote-tracking branch 'origin/feat-documentsdb' into feat-vect…
premtsd-code Mar 21, 2026
d89fad8
Merge remote-tracking branch 'origin/feat-documentsdb' into feat-vect…
premtsd-code Mar 21, 2026
b259318
(fix): import Columns type from correct module in sheetOptions
premtsd-code Mar 21, 2026
d735f7f
(fix): remove databaseType param from suggestColumns call
premtsd-code Mar 21, 2026
51b499a
(chore): update console SDK to 2291c59 with rebuilt dist
premtsd-code Mar 21, 2026
8c29b65
Merge remote-tracking branch 'origin/feat-documentsdb' into feat-vect…
premtsd-code Mar 21, 2026
2a5aa4d
(fix): embedding fold preview with inline values, vectorsdb sample da…
premtsd-code Mar 22, 2026
3482580
add vectorsdb document-level activity logs
premtsd-code Mar 22, 2026
6eef1c0
feat: update SDK to pkg.vc preview with vectorsdb DatabaseType enum
premtsd-code Mar 23, 2026
995af51
fix: remove misleading DocumentsDBIndexType cast for vectorsdb compat…
premtsd-code Mar 23, 2026
902ea0a
merge: feat-documentsdb into feat-vectordb
premtsd-code Mar 24, 2026
fecbdaf
Merge feat-documentsdb into feat-vectordb
premtsd-code Mar 25, 2026
c85040c
address review: requestMeasure for folding, shared HintBadge, remove …
premtsd-code Mar 25, 2026
47a660c
embeddings fold: native gutter chevron, truncated value preview, resp…
premtsd-code Mar 25, 2026
462177c
fix: override picomatch to 4.0.4 for ReDoS vulnerability
premtsd-code Mar 26, 2026
5860ca1
add JSON import/export UI for documentsdb and vectorsdb collections
premtsd-code Mar 26, 2026
88bfd27
merge feat-documentsdb into feat-vectordb
premtsd-code Mar 29, 2026
db01d28
merge feat-documentsdb into feat-vectordb
premtsd-code Mar 30, 2026
8f5aa4a
vectorsdb create index: dynamic form per index type, HNSW auto-fills …
premtsd-code Mar 30, 2026
fdcb779
merge: feat-documentsdb into feat-vectordb, update SDK to d27fbd5
premtsd-code Apr 3, 2026
1d9e737
merge: resolve conflicts with remote feat-vectordb
premtsd-code Apr 3, 2026
dfdf507
Merge remote-tracking branch 'origin/feat-documentsdb' into feat-vect…
premtsd-code Apr 16, 2026
83b7668
Merge remote-tracking branch 'origin/feat-documentsdb' into feat-vect…
premtsd-code Apr 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
"immutable": "^5.1.5",
"flatted": "^3.4.2",
"yaml": "^1.10.3",
"picomatch": "^2.3.2",
"picomatch": "^4.0.4",
"cookie": "^0.7.0"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@
title: 'DocumentsDB',
subtitle:
'Store flexible data without a fixed schema. Best for unstructured data and simple querying.'
},
{
type: 'vectorsdb',
title: 'VectorsDB',
subtitle:
'Store data as vectors to find similar results. Best for semantic search and recommendations.'
}
];

Expand Down Expand Up @@ -276,7 +282,7 @@
{/snippet}

{#snippet selectDatabaseType(disabled = false)}
<Layout.Grid columns={2} columnsS={1}>
<Layout.Grid columns={3} columnsS={1}>
{#each databaseTypes as databaseType}
<div class="card-selector">
<Card.Selector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import type {
Models,
OrderBy,
TablesDBIndexType,
DocumentsDBIndexType
DocumentsDBIndexType,
VectorsDBIndexType
} from '@appwrite.io/console';

export type DatabaseSdkResult = {
Expand All @@ -35,6 +36,7 @@ export type DatabaseSdkResult = {
entityId: string;
name: string;
databaseType?: DatabaseType;
dimension?: number /* vectorsDB specific */;
}) => Promise<Entity>;
getEntity: (params: {
databaseId: string;
Expand All @@ -53,6 +55,15 @@ export type DatabaseSdkResult = {
entityId: string;
databaseType?: DatabaseType;
}) => Promise<{}>;
updateEntity: (params: {
databaseId: string;
entityId: string;
name?: string;
permissions?: string[];
documentSecurity?: boolean;
enabled?: boolean;
databaseType?: DatabaseType;
}) => Promise<Entity>;
createRecord: (params: {
databaseId: string;
entityId: string;
Expand Down Expand Up @@ -98,8 +109,30 @@ export type DatabaseSdkResult = {
orders?: OrderBy[];
databaseType?: DatabaseType;
}) => Promise<Index>;
deleteIndex: (params: {
databaseId: string;
entityId: string;
key: string;
databaseType?: DatabaseType;
}) => Promise<{}>;
};

/**
* Returns the raw DocumentsDB or VectorsDB SDK service for a given database type.
* Use in load functions (.ts) where Svelte runes aren't available.
*/
export function getCollectionService(region: string, project: string, type: DatabaseType) {
const projectSdk = sdk.forProject(region, project);
switch (type) {
case 'documentsdb':
return projectSdk.documentsDB;
case 'vectorsdb':
return projectSdk.vectorsDB;
default:
throw new Error(`Unsupported collection database type: ${type}`);
}
}

export function useDatabaseSdk(
regionOrPage: string | Page,
projectOrTerminology: string | TerminologyResult,
Expand Down Expand Up @@ -131,8 +164,9 @@ export function useDatabaseSdk(
case 'documentsdb': {
return await baseSdk.documentsDB.create(params);
}
case 'vectorsdb':
throw new Error('Database type not supported yet');
case 'vectorsdb': {
return await baseSdk.vectorsDB.create(params);
}
default:
throw new Error('Unknown database type');
}
Expand All @@ -141,7 +175,8 @@ export function useDatabaseSdk(
async list(params): Promise<Models.DatabaseList> {
const results = await Promise.all([
baseSdk.tablesDB.list(params),
baseSdk.documentsDB.list(params)
baseSdk.documentsDB.list(params),
baseSdk.vectorsDB.list(params)
]);

return results.reduce(
Expand Down Expand Up @@ -171,8 +206,15 @@ export function useDatabaseSdk(

return toSupportiveEntity(table);
}
case 'vectorsdb':
throw new Error('Database type not supported yet');
case 'vectorsdb': {
const collection = await baseSdk.vectorsDB.createCollection({
...params,
dimension: params.dimension,
collectionId: params.entityId
});

return toSupportiveEntity(collection);
}
default:
throw new Error('Unknown database type');
}
Expand All @@ -190,8 +232,10 @@ export function useDatabaseSdk(
await baseSdk.documentsDB.listCollections(params);
return { total, entities: collections.map(toSupportiveEntity) };
}
case 'vectorsdb':
throw new Error(`Database type not supported yet`);
case 'vectorsdb': {
const { total, collections } = await baseSdk.vectorsDB.listCollections(params);
return { total, entities: collections.map(toSupportiveEntity) };
}
default:
throw new Error(`Unknown database type`);
}
Expand All @@ -215,8 +259,14 @@ export function useDatabaseSdk(

return toSupportiveEntity(collection);
}
case 'vectorsdb':
throw new Error(`Database type not supported yet`);
case 'vectorsdb': {
const collection = await baseSdk.vectorsDB.getCollection({
databaseId: params.databaseId,
collectionId: params.entityId
});

return toSupportiveEntity(collection);
}
default:
throw new Error(`Unknown database type`);
}
Expand All @@ -230,7 +280,7 @@ export function useDatabaseSdk(
case 'documentsdb':
return await baseSdk.documentsDB.delete(params);
case 'vectorsdb':
throw new Error('Database type not supported yet');
return await baseSdk.vectorsDB.delete(params);
default:
throw new Error(`Unknown database type`);
}
Expand All @@ -250,7 +300,51 @@ export function useDatabaseSdk(
collectionId: params.entityId
});
case 'vectorsdb':
throw new Error('Database type not supported yet');
return await baseSdk.vectorsDB.deleteCollection({
databaseId: params.databaseId,
collectionId: params.entityId
});
default:
throw new Error(`Unknown database type`);
}
},

async updateEntity(params) {
switch (type ?? params.databaseType) {
case 'legacy': /* databases api */
case 'tablesdb':
return toSupportiveEntity(
await baseSdk.tablesDB.updateTable({
databaseId: params.databaseId,
tableId: params.entityId,
name: params.name,
permissions: params.permissions,
rowSecurity: params.documentSecurity,
enabled: params.enabled
})
);
case 'documentsdb':
return toSupportiveEntity(
await baseSdk.documentsDB.updateCollection({
databaseId: params.databaseId,
collectionId: params.entityId,
name: params.name,
permissions: params.permissions,
documentSecurity: params.documentSecurity,
enabled: params.enabled
})
);
case 'vectorsdb':
return toSupportiveEntity(
await baseSdk.vectorsDB.updateCollection({
databaseId: params.databaseId,
collectionId: params.entityId,
name: params.name,
permissions: params.permissions,
documentSecurity: params.documentSecurity,
enabled: params.enabled
})
);
default:
throw new Error(`Unknown database type`);
}
Expand All @@ -275,8 +369,15 @@ export function useDatabaseSdk(
data: params.data,
permissions: params.permissions
});
case 'vectorsdb':
throw new Error('Database type not supported yet');
case 'vectorsdb': {
return await baseSdk.vectorsDB.createDocument({
databaseId: params.databaseId,
collectionId: params.entityId,
documentId: params.recordId,
data: params.data,
permissions: params.permissions
});
}
default:
throw new Error(`Unknown database type`);
}
Expand All @@ -301,8 +402,15 @@ export function useDatabaseSdk(
data: params.data,
permissions: params.permissions
});
case 'vectorsdb':
throw new Error('Database type not supported yet');
case 'vectorsdb': {
return await baseSdk.vectorsDB.upsertDocument({
databaseId: params.databaseId,
collectionId: params.entityId,
documentId: params.recordId,
data: params.data,
permissions: params.permissions
});
}
default:
throw new Error(`Unknown database type`);
}
Expand All @@ -325,8 +433,14 @@ export function useDatabaseSdk(
documentId: params.recordId,
permissions: params.permissions
});
case 'vectorsdb':
throw new Error('Database type not supported yet');
case 'vectorsdb': {
return await baseSdk.vectorsDB.upsertDocument({
databaseId: params.databaseId,
collectionId: params.entityId,
documentId: params.recordId,
permissions: params.permissions
});
}
default:
throw new Error(`Unknown database type`);
}
Expand All @@ -351,8 +465,19 @@ export function useDatabaseSdk(
});
return toSupportiveRecord(document);
}
case 'vectorsdb':
throw new Error('Database type not supported yet');
case 'vectorsdb': {
if (!params.recordId) {
throw new Error('Record ID is required to delete a VectorsDB document');
}

const document = await baseSdk.vectorsDB.deleteDocument({
databaseId: params.databaseId,
collectionId: params.entityId,
documentId: params.recordId
});

return toSupportiveRecord(document);
}
default:
throw new Error(`Unknown database type`);
}
Expand All @@ -377,8 +502,15 @@ export function useDatabaseSdk(
});
return { total, records: documents.map(toSupportiveRecord) };
}
case 'vectorsdb':
throw new Error('Database type not supported yet');
case 'vectorsdb': {
const { total, documents } = await baseSdk.vectorsDB.deleteDocuments({
databaseId: params.databaseId,
collectionId: params.entityId,
queries: params.queries
});

return { total, records: documents.map(toSupportiveRecord) };
}
default:
throw new Error(`Unknown database type`);
}
Expand Down Expand Up @@ -411,8 +543,45 @@ export function useDatabaseSdk(
});
return toSupportiveIndex(index);
}
case 'vectorsdb': {
const index = await baseSdk.vectorsDB.createIndex({
databaseId: params.databaseId,
collectionId: params.entityId,
key: params.key,
type: params.type as VectorsDBIndexType,
attributes: params.attributes,
lengths: params.lengths,
orders: params.orders
});

return toSupportiveIndex(index);
}
default:
throw new Error(`Unknown database type`);
}
},

async deleteIndex(params) {
switch (type ?? params.databaseType) {
case 'legacy': /* databases api */
case 'tablesdb':
return await baseSdk.tablesDB.deleteIndex({
databaseId: params.databaseId,
tableId: params.entityId,
key: params.key
});
case 'documentsdb':
return await baseSdk.documentsDB.deleteIndex({
databaseId: params.databaseId,
collectionId: params.entityId,
key: params.key
});
case 'vectorsdb':
throw new Error('Database type not supported yet');
return await baseSdk.vectorsDB.deleteIndex({
databaseId: params.databaseId,
collectionId: params.entityId,
key: params.key
});
default:
throw new Error(`Unknown database type`);
}
Expand Down
Loading
Loading