Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 7 additions & 7 deletions apps/chat2db-desktop/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ use chat2db_contract::{
UpdateDatasourceRequest, UpdateProviderProfileRequest, ValidateCommunitySqlRequest,
};
use chat2db_core::{
AppError, Application, MysqlConsoleCancellation, RuntimeConfig, RuntimeHost,
AppError, Application, NativeConsoleCancellation, RuntimeConfig, RuntimeHost,
load_fixed_community_classpath,
};
use chat2db_java_bridge::{BridgeError, EngineCommand, EngineConfig};
Expand Down Expand Up @@ -222,11 +222,11 @@ impl DesktopStartup {

#[derive(Default)]
struct LegacySqlCancellationRegistry {
cancellations: Mutex<HashMap<String, MysqlConsoleCancellation>>,
cancellations: Mutex<HashMap<String, NativeConsoleCancellation>>,
}

impl LegacySqlCancellationRegistry {
async fn insert(&self, execution_id: String, cancellation: MysqlConsoleCancellation) {
async fn insert(&self, execution_id: String, cancellation: NativeConsoleCancellation) {
self.cancellations
.lock()
.await
Expand Down Expand Up @@ -1054,7 +1054,7 @@ async fn legacy_client_command_for(
})
.map(|id| format!("mysql-console-{id}"))
.map_err(|_| "No MySQL Console execution ids remain".to_owned())?;
let cancellation = MysqlConsoleCancellation::new();
let cancellation = NativeConsoleCancellation::new();
state
.legacy_sql_cancellations
.insert(execution_id.clone(), cancellation.clone())
Expand Down Expand Up @@ -1278,7 +1278,7 @@ async fn forward_native_mysql_sql_execution(
request_uuid: String,
execution_id: String,
request: chat2db_web::legacy::LegacySqlExecuteRequest,
cancellation: MysqlConsoleCancellation,
cancellation: NativeConsoleCancellation,
) {
let started_at = Instant::now();
let mut sequence = 0_u64;
Expand Down Expand Up @@ -2766,7 +2766,7 @@ mod tests {
OperationEvent, OperationEventEnvelope, OperationStreamMessage,
StartCommunityTablePreviewRequest, ValidateCommunitySqlRequest,
};
use chat2db_core::{AppError, Application, MysqlConsoleCancellation};
use chat2db_core::{AppError, Application, NativeConsoleCancellation};
use tokio::sync::oneshot;

use super::{
Expand Down Expand Up @@ -2989,7 +2989,7 @@ mod tests {
#[tokio::test]
async fn native_mysql_cancellation_registry_owns_execution_lifecycle() {
let registry = LegacySqlCancellationRegistry::default();
let cancellation = MysqlConsoleCancellation::new();
let cancellation = NativeConsoleCancellation::new();
registry
.insert("mysql-console-1".to_owned(), cancellation.clone())
.await;
Expand Down
20 changes: 10 additions & 10 deletions apps/chat2db-web/src/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ use chat2db_contract::{
};
use chat2db_core::{
AppError, AppErrorKind, Application, LargeValueChunk, LargeValueEncoding, LargeValuePreview,
LargeValueType, MysqlConsoleCancellation, MysqlConsoleRequest, MysqlConsoleResult,
LargeValueType, NativeConsoleCancellation, NativeConsoleRequest, NativeConsoleResult,
TransferArtifactDownload,
mysql_ddl::{
MysqlColumnAlter, MysqlColumnDefinition, MysqlColumnPosition, MysqlDatabaseDefinition,
Expand Down Expand Up @@ -5381,7 +5381,7 @@ pub async fn execute_sql(
return Box::pin(execute_mysql_sql(
application,
request,
MysqlConsoleCancellation::new(),
NativeConsoleCancellation::new(),
&execution_id,
"SQL_EDITOR_HTTP",
))
Expand Down Expand Up @@ -5452,8 +5452,8 @@ pub(crate) async fn count_mysql_rows(
}
let count_sql = build_mysql_count_query(&request.sql)?;
let results = application
.execute_mysql_console(
MysqlConsoleRequest {
.execute_native_console(
NativeConsoleRequest {
datasource_id,
database_name: request.database_name.clone(),
sql: count_sql,
Expand All @@ -5465,7 +5465,7 @@ pub(crate) async fn count_mysql_rows(
explain: false,
error_continue: false,
},
MysqlConsoleCancellation::new(),
NativeConsoleCancellation::new(),
)
.await?;
let result = results.into_iter().next().ok_or_else(|| {
Expand Down Expand Up @@ -5518,7 +5518,7 @@ pub(crate) async fn count_mysql_rows(
pub async fn execute_mysql_sql(
application: &Application,
request: &LegacySqlExecuteRequest,
cancellation: MysqlConsoleCancellation,
cancellation: NativeConsoleCancellation,
execution_id: &str,
history_source: &str,
) -> LegacyResult<Vec<LegacyManageResult>> {
Expand All @@ -5541,8 +5541,8 @@ pub async fn execute_mysql_sql(
.map(|columns| columns.items)
};

let execution = application.execute_mysql_console(
MysqlConsoleRequest {
let execution = application.execute_native_console(
NativeConsoleRequest {
datasource_id,
database_name: request.database_name.clone(),
sql: request.sql.clone(),
Expand Down Expand Up @@ -5950,10 +5950,10 @@ fn mysql_console_result(
application: &Application,
large_value_owner: &str,
request: &LegacySqlExecuteRequest,
result: MysqlConsoleResult,
result: NativeConsoleResult,
editable_columns: Option<&[CommunityTableColumn]>,
) -> LegacyManageResult {
let MysqlConsoleResult {
let NativeConsoleResult {
statement_sequence,
result_set_id,
sql,
Expand Down
Loading
Loading