diff --git a/package.json b/package.json
index 3c2162071..a02a8af39 100644
--- a/package.json
+++ b/package.json
@@ -94,5 +94,5 @@
"svelte-preprocess"
]
},
- "packageManager": "pnpm@10.7.0+sha512.6b865ad4b62a1d9842b61d674a393903b871d9244954f652b8842c2b553c72176b278f64c463e52d40fff8aba385c235c8c9ecf5cc7de4fd78b8bb6d49633ab6"
+ "packageManager": "pnpm@10.13.1"
}
diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts
index d9c86e0d9..e3ac82596 100644
--- a/src/lib/actions/analytics.ts
+++ b/src/lib/actions/analytics.ts
@@ -148,9 +148,9 @@ export enum Click {
ConnectRepositoryClick = 'click_connect_repository',
CreditsRedeemClick = 'click_credits_redeem',
CloudSignupClick = 'click_cloud_signup',
- DatabaseAttributeDelete = 'click_attribute_delete',
+ DatabaseColumnDelete = 'click_column_delete',
DatabaseIndexDelete = 'click_index_delete',
- DatabaseCollectionDelete = 'click_collection_delete',
+ DatabaseTableDelete = 'click_table_delete',
DatabaseDatabaseDelete = 'click_database_delete',
DatabaseImportCsv = 'click_database_import_csv',
DomainCreateClick = 'click_domain_create',
@@ -273,22 +273,22 @@ export enum Submit {
DatabaseDelete = 'submit_database_delete',
DatabaseUpdateName = 'submit_database_update_name',
DatabaseImportCsv = 'submit_database_import_csv',
- AttributeCreate = 'submit_attribute_create',
- AttributeUpdate = 'submit_attribute_update',
- AttributeDelete = 'submit_attribute_delete',
- DocumentCreate = 'submit_document_create',
- DocumentDelete = 'submit_document_delete',
- DocumentUpdate = 'submit_document_update',
- DocumentUpdatePermissions = 'submit_document_update_permissions',
+ ColumnCreate = 'submit_column_create',
+ ColumnUpdate = 'submit_column_update',
+ ColumnDelete = 'submit_column_delete',
+ RowCreate = 'submit_row_create',
+ RowDelete = 'submit_row_delete',
+ RowUpdate = 'submit_row_update',
+ RowUpdatePermissions = 'submit_row_update_permissions',
IndexCreate = 'submit_index_create',
IndexDelete = 'submit_index_delete',
- CollectionCreate = 'submit_collection_create',
- CollectionDelete = 'submit_collection_delete',
- CollectionUpdateName = 'submit_collection_update_name',
- CollectionUpdatePermissions = 'submit_collection_update_permissions',
- CollectionUpdateSecurity = 'submit_collection_update_security',
- CollectionUpdateEnabled = 'submit_collection_update_enabled',
- CollectionUpdateDisplayNames = 'submit_collection_update_display_names',
+ TableCreate = 'submit_row_create',
+ TableDelete = 'submit_row_delete',
+ TableUpdateName = 'submit_row_update_name',
+ TableUpdatePermissions = 'submit_row_update_permissions',
+ TableUpdateSecurity = 'submit_row_update_security',
+ TableUpdateEnabled = 'submit_row_update_enabled',
+ TableUpdateDisplayNames = 'submit_row_update_display_names',
FunctionCreate = 'submit_function_create',
FunctionDelete = 'submit_function_delete',
FunctionUpdateName = 'submit_function_update_name',
diff --git a/src/lib/commandCenter/commands.ts b/src/lib/commandCenter/commands.ts
index b191b892f..fa8427d30 100644
--- a/src/lib/commandCenter/commands.ts
+++ b/src/lib/commandCenter/commands.ts
@@ -28,10 +28,10 @@ const groups = [
'integrations',
'migrations',
'users',
- 'collections',
- 'attributes',
+ 'tables',
+ 'columns',
'indexes',
- 'documents',
+ 'rows',
'teams',
'security',
'buckets',
diff --git a/src/lib/commandCenter/panels/ai.svelte b/src/lib/commandCenter/panels/ai.svelte
index 58407c678..5181a99a2 100644
--- a/src/lib/commandCenter/panels/ai.svelte
+++ b/src/lib/commandCenter/panels/ai.svelte
@@ -27,7 +27,7 @@
const examples = [
'How to add platform in the console?',
'How can I manage users, permissions, and access control in Appwrite?',
- 'How can I set up database collections and documents in Appwrite?',
+ 'How can I set up database tables and rows in Appwrite?',
'How do I configure and manage server-side functions in Appwrite?',
'How to add custom domain in the console?'
];
diff --git a/src/lib/commandCenter/panels/createAttribute.svelte b/src/lib/commandCenter/panels/createColumn.svelte
similarity index 58%
rename from src/lib/commandCenter/panels/createAttribute.svelte
rename to src/lib/commandCenter/panels/createColumn.svelte
index 98d312698..3a3cea77f 100644
--- a/src/lib/commandCenter/panels/createAttribute.svelte
+++ b/src/lib/commandCenter/panels/createColumn.svelte
@@ -1,16 +1,16 @@
diff --git a/src/lib/commandCenter/searchers/collections.ts b/src/lib/commandCenter/searchers/collections.ts
deleted file mode 100644
index c3ffaebe9..000000000
--- a/src/lib/commandCenter/searchers/collections.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import { goto } from '$app/navigation';
-import { database } from '$routes/(console)/project-[region]-[project]/databases/database-[database]/store';
-import { get } from 'svelte/store';
-import type { Searcher } from '../commands';
-import { sdk } from '$lib/stores/sdk';
-import { base } from '$app/paths';
-import { page } from '$app/state';
-
-export const collectionsSearcher = (async (query: string) => {
- const databaseId = get(database).$id;
- const { collections } = await sdk
- .forProject(page.params.region, page.params.project)
- .databases.listCollections(databaseId);
-
- return collections
- .filter((col) => col.name.toLowerCase().includes(query.toLowerCase()))
- .map(
- (col) =>
- ({
- group: 'collections',
- label: col.name,
- callback: () => {
- goto(
- `${base}/project-${page.params.region}-${page.params.project}/databases/database-${databaseId}/collection-${col.$id}`
- );
- }
- }) as const
- );
-}) satisfies Searcher;
diff --git a/src/lib/commandCenter/searchers/index.ts b/src/lib/commandCenter/searchers/index.ts
index 0f78e8c90..d4461c2a1 100644
--- a/src/lib/commandCenter/searchers/index.ts
+++ b/src/lib/commandCenter/searchers/index.ts
@@ -1,7 +1,7 @@
export * from './databases';
export * from './users';
export * from './organizations';
-export * from './collections';
+export * from './tables';
export * from './projects';
export * from './teams';
export * from './functions';
diff --git a/src/lib/commandCenter/searchers/tables.ts b/src/lib/commandCenter/searchers/tables.ts
new file mode 100644
index 000000000..1a8af1411
--- /dev/null
+++ b/src/lib/commandCenter/searchers/tables.ts
@@ -0,0 +1,27 @@
+import { goto } from '$app/navigation';
+import type { Searcher } from '../commands';
+import { sdk } from '$lib/stores/sdk';
+import { base } from '$app/paths';
+import { page } from '$app/state';
+
+export const tablesSearcher = (async (query: string) => {
+ const databaseId = page.params.database;
+ const { tables } = await sdk
+ .forProject(page.params.region, page.params.project)
+ .tables.list(databaseId);
+
+ return tables
+ .filter((table) => table.name.toLowerCase().includes(query.toLowerCase()))
+ .map(
+ (table) =>
+ ({
+ group: 'tables',
+ label: table.name,
+ callback: () => {
+ goto(
+ `${base}/project-${page.params.region}-${page.params.project}/databases/database-${databaseId}/table-${table.$id}`
+ );
+ }
+ }) as const
+ );
+}) satisfies Searcher;
diff --git a/src/lib/components/backupRestoreBox.svelte b/src/lib/components/backupRestoreBox.svelte
index 1598341f7..2f660985e 100644
--- a/src/lib/components/backupRestoreBox.svelte
+++ b/src/lib/components/backupRestoreBox.svelte
@@ -57,6 +57,7 @@
}
function updateOrAddItem(payload: Payload) {
+ // todo: @itznotabug - might need a change to $table?
const { $id, status, $collection, policyId } = payload;
if ($collection === 'archives' && policyId !== null) {
return;
@@ -117,9 +118,9 @@
}
function backupName(item: BackupArchive | BackupRestoration, key: string) {
- const attribute = key === 'archives' ? '$createdAt' : 'startedAt';
+ const column = key === 'archives' ? '$createdAt' : 'startedAt';
- return toLocaleDate(item[attribute]);
+ return toLocaleDate(item[column]);
}
onMount(() => {
diff --git a/src/lib/components/columnSelector.svelte b/src/lib/components/columnSelector.svelte
index a899fe9e4..54d8ace9e 100644
--- a/src/lib/components/columnSelector.svelte
+++ b/src/lib/components/columnSelector.svelte
@@ -8,19 +8,18 @@
let {
columns,
- isCustomCollection = false,
+ isCustomTable = false,
allowNoColumns = false,
children
}: {
columns: Writable;
- isCustomCollection?: boolean;
+ isCustomTable?: boolean;
allowNoColumns?: boolean;
children: Snippet<[toggle: () => void, selectedColumnsNumber: number]>;
} = $props();
let maxHeight = $state('none');
let containerRef = $state(null);
- const collectionId = $derived(page.params.collection);
const calcMaxHeight = () => {
if (containerRef) {
@@ -35,16 +34,16 @@
const saveColumnPreferences = () => {
const shownColumns = $columns.filter((n) => n.hide === true).map((n) => n.id);
- if (isCustomCollection) {
- preferences.setCustomCollectionColumns(collectionId, shownColumns);
+ if (isCustomTable) {
+ preferences.setCustomTableColumns(page.params.table, shownColumns);
} else {
preferences.setColumns(shownColumns);
}
};
onMount(() => {
- if (isCustomCollection) {
- const shownColumns = preferences.getCustomCollectionColumns(collectionId);
+ if (isCustomTable) {
+ const shownColumns = preferences.getCustomTableColumns(page.params.table);
columns.update((n) =>
n.map((column) => {
diff --git a/src/lib/components/csvImportBox.svelte b/src/lib/components/csvImportBox.svelte
index 60f93abf6..443463d00 100644
--- a/src/lib/components/csvImportBox.svelte
+++ b/src/lib/components/csvImportBox.svelte
@@ -13,7 +13,7 @@
type ImportItem = {
status: string;
- collection?: string;
+ table?: string;
};
type ImportItemsMap = Map;
@@ -22,15 +22,11 @@
* Keeps a track of the active and ongoing csv migrations.
*
* The structure is as follows -
- * `{ migrationId: { status: status, collection: collection } }`
+ * `{ migrationId: { status: status, table: table } }`
*/
const importItems: Writable = writable(new Map());
- async function showCompletionNotification(
- database: string,
- collection: string,
- payload: Payload
- ) {
+ async function showCompletionNotification(database: string, table: string, payload: Payload) {
const isSuccess = payload.status === 'completed';
const isError = !isSuccess && !!payload.errors;
@@ -48,20 +44,20 @@
const type = isSuccess ? 'success' : 'error';
const message = isError ? errorMessage : 'CSV import finished successfully.';
- const url = `${base}/project-${page.params.region}-${page.params.project}/databases/database-${database}/collection-${collection}`;
+ const url = `${base}/project-${page.params.region}-${page.params.project}/databases/database-${database}/table-${table}`;
addNotification({
type,
message,
isHtml: true,
buttons:
- isSuccess && collection !== page.params.collection
- ? [{ name: 'View documents', method: () => goto(url) }]
+ isSuccess && table !== page.params.table
+ ? [{ name: 'View rows', method: () => goto(url) }]
: undefined
});
if (isSuccess) {
- await invalidate(Dependencies.DOCUMENTS);
+ await invalidate(Dependencies.ROWS);
}
}
@@ -70,19 +66,19 @@
const status = importData.status;
const resourceId = importData.resourceId ?? '';
- const [databaseId, collectionId] = resourceId.split(':') ?? [];
+ const [databaseId, tableId] = resourceId.split(':') ?? [];
const current = $importItems.get(importData.$id);
- let collectionName = current?.collection ?? null;
+ let tableName = current?.table ?? null;
- if (!collectionName && collectionId) {
+ if (!tableName && tableId) {
try {
- const collection = await sdk
+ const table = await sdk
.forProject(page.params.region, page.params.project)
- .databases.getCollection(databaseId, collectionId);
- collectionName = collection.name;
+ .tables.get(databaseId, tableId);
+ tableName = table.name;
} catch {
- collectionName = null;
+ tableName = null;
}
}
@@ -99,12 +95,12 @@
if (shouldSkip) return items;
const next = new Map(items);
- next.set(importData.$id, { status, collection: collectionName ?? undefined });
+ next.set(importData.$id, { status, table: tableName ?? undefined });
return next;
});
if (status === 'completed' || status === 'failed') {
- await showCompletionNotification(databaseId, collectionId, importData);
+ await showCompletionNotification(databaseId, tableId, importData);
}
}
@@ -172,7 +168,7 @@