From 2433acb1f1077cae7e46d8e7100db8d4d1ee240a Mon Sep 17 00:00:00 2001 From: David Snelling Date: Fri, 20 Jun 2025 10:57:11 -0700 Subject: [PATCH] **feat: update terminology from 'restore' to 'import' for sparse data operations** ### Changes: - Updated button label in `examples/demo.html` from "Restore Sparse Data" to "Import Sparse Data". - Replaced references to `restoreSparseData` with `importSparseData` across code: - Event listener for the sparse data button now uses `importSparseData`. - Function name changed to `importSparseData` to reflect new terminology. - Logging messages updated for consistency ("restored" -> "imported"). - Modified the database operation to use `importSparseData` for better alignment with the updated terminology. ### Purpose: Improved clarity and consistency in terminology related to sparse data operations. The term "import" better aligns with its functionality and enhances user understanding across the application. --- examples/demo.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/demo.html b/examples/demo.html index c8142c9d..a869920a 100644 --- a/examples/demo.html +++ b/examples/demo.html @@ -675,7 +675,7 @@ await db.init() - +
@@ -1027,7 +1027,7 @@ await db.init() document.getElementById('clear-db-btn').addEventListener('click', clearDatabase) document.getElementById('export-data-btn').addEventListener('click', backupData) document.getElementById('import-data-btn').addEventListener('click', restoreData) - document.getElementById('import-sparse-data-btn').addEventListener('click', restoreSparseData) + document.getElementById('import-sparse-data-btn').addEventListener('click', importSparseData) // Data model operations - Legacy buttons document.getElementById('add-entity-btn')?.addEventListener('click', addEntity) @@ -1481,8 +1481,8 @@ await db.init() input.click() } - // Function to create and restore sparse data (without vectors) - async function restoreSparseData() { + // Function to create and import sparse data (without vectors) + async function importSparseData() { if (!database) { log('db-status', 'Please initialize database first') return @@ -1521,13 +1521,13 @@ await db.init() version: '1.0.0' } - // Restore the sparse data - await database.restore(sparseData) - log('db-status', 'Sparse data restored successfully') + // Import the sparse data + await database.importSparseData(sparseData) + log('db-status', 'Sparse data imported successfully') log('db-status', 'Vectors were automatically created for items without vectors') updateDatabaseVisualization() } catch (error) { - log('db-status', 'Error restoring sparse data: ' + error.message) + log('db-status', 'Error importing sparse data: ' + error.message) } }