feat(meilisearch): add native document database support
This commit is contained in:
79 files changed
+1801
-170
No files matched your search
@@ -1001,6 +1001,18 @@ async fn test_connection_with_info_inner(
|
||||
.await
|
||||
.map(|_| "Connection successful".to_string())
|
||||
}
|
||||
DatabaseType::Meilisearch => {
|
||||
let client = db::meilisearch_driver::MeilisearchClient::new(
|
||||
&url,
|
||||
Some(&config.password),
|
||||
config.ssl,
|
||||
config.url_params.as_deref(),
|
||||
connect_timeout,
|
||||
)?;
|
||||
db::meilisearch_driver::test_connection(&client, connect_timeout)
|
||||
.await
|
||||
.map(|_| "Connection successful".to_string())
|
||||
}
|
||||
DatabaseType::Hbase => {
|
||||
let client = db::hbase_driver::HBaseClient::new(
|
||||
&url,
|
||||
@@ -1371,6 +1383,17 @@ pub async fn connect_db(
|
||||
db::easysearch_driver::test_connection(&mut client, connect_timeout).await?;
|
||||
PoolKind::Easysearch(client)
|
||||
}
|
||||
DatabaseType::Meilisearch => {
|
||||
let client = db::meilisearch_driver::MeilisearchClient::new(
|
||||
&url,
|
||||
Some(&db_config.password),
|
||||
db_config.ssl,
|
||||
db_config.url_params.as_deref(),
|
||||
connect_timeout,
|
||||
)?;
|
||||
db::meilisearch_driver::test_connection(&client, connect_timeout).await?;
|
||||
PoolKind::Meilisearch(client)
|
||||
}
|
||||
DatabaseType::Hbase => {
|
||||
let client = db::hbase_driver::HBaseClient::new(
|
||||
&url,
|
||||
|
||||
@@ -177,6 +177,27 @@ pub async fn document_delete_document(
|
||||
.await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn document_save_meilisearch_batch(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
collection: String,
|
||||
updates: Vec<dbx_core::db::meilisearch_driver::MeilisearchDocumentUpdate>,
|
||||
delete_ids: Vec<String>,
|
||||
inserts: Vec<String>,
|
||||
) -> Result<u64, String> {
|
||||
ensure_connection_writable(&state, &connection_id, "Save").await?;
|
||||
dbx_core::document_ops::save_meilisearch_document_batch_core(
|
||||
&state,
|
||||
&connection_id,
|
||||
&collection,
|
||||
&updates,
|
||||
&delete_ids,
|
||||
&inserts,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn document_list_gridfs_buckets(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
|
||||
@@ -2010,6 +2010,7 @@ pub fn run() {
|
||||
commands::mongo_cmd::mongo_update_document,
|
||||
commands::mongo_cmd::mongo_update_documents,
|
||||
commands::document_cmd::document_delete_document,
|
||||
commands::document_cmd::document_save_meilisearch_batch,
|
||||
commands::hbase_cmd::hbase_get_table_schema,
|
||||
commands::hbase_cmd::hbase_scan_rows,
|
||||
commands::hbase_cmd::hbase_get_row,
|
||||
|
||||
Reference in new issue
Block a user