chore(chdb): add extra condition on the engine to be abortable or not
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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[]>;
|
||||
|
||||
@@ -484,7 +484,7 @@ LIMIT 100;`;
|
||||
>
|
||||
<Save size="12" />
|
||||
</button>
|
||||
{#if loading}
|
||||
{#if loading && engine.isAbortable}
|
||||
<button
|
||||
class="action"
|
||||
title="Cancel"
|
||||
|
||||
Reference in New Issue
Block a user