chore(chdb): add extra condition on the engine to be abortable or not

This commit is contained in:
Yann Amsellem
2025-04-24 10:32:24 +02:00
parent 445609e196
commit 8a6aab7841
4 changed files with 6 additions and 1 deletions

View File

@@ -7,6 +7,8 @@ import CLICKHOUSE_GET_UDFS from './queries/clickhouse_get_udfs.sql?raw';
import CLICKHOUSE_INIT_DB from './queries/clickhouse_init_db.sql?raw';
export class CHDBEngine extends InternalEventEmitter<Events> implements OLAPEngine {
readonly isAbortable = false;
async init() {
await this.exec(CLICKHOUSE_INIT_DB);
}

View File

@@ -5,6 +5,8 @@ import CLICKHOUSE_GET_SCHEMA from './queries/clickhouse_get_schema.sql?raw';
import CLICKHOUSE_GET_UDFS from './queries/clickhouse_get_udfs.sql?raw';
export class RemoteEngine extends InternalEventEmitter<Events> implements OLAPEngine {
readonly isAbortable = true;
async init() {}
async exec(query: string, options: ExecOptions = {}, _emit = true) {

View File

@@ -31,6 +31,7 @@ export type Events = 'error' | 'success';
export type ExecOptions = { signal?: AbortSignal | null };
export interface OLAPEngine extends IListener<Events> {
readonly isAbortable: boolean;
init(): Promise<void>;
exec(query: string, options?: ExecOptions): Promise<OLAPResponse | undefined>;
getSchema(): Promise<Table[]>;

View File

@@ -484,7 +484,7 @@ LIMIT 100;`;
>
<Save size="12" />
</button>
{#if loading}
{#if loading && engine.isAbortable}
<button
class="action"
title="Cancel"