fix: scope query connections by client session
This commit is contained in:
1 parent
ac65508ddb
commit
d326cb0ced
17 files changed
+290
-44
No files matched your search
@@ -89,6 +89,7 @@ export const executeScript = forward("executeScript");
|
||||
export const executeInTransaction = forward("executeInTransaction");
|
||||
export const cancelQuery = forward("cancelQuery");
|
||||
export const closeQuerySession = forward("closeQuerySession");
|
||||
export const closeClientConnectionSession = forward("closeClientConnectionSession");
|
||||
export const analyzeSqlReferences = forward("analyzeSqlReferences");
|
||||
export const findStatementAtCursor = forward("findStatementAtCursor");
|
||||
export const prepareQueryPaginationExecutionPlan = forward("prepareQueryPaginationExecutionPlan");
|
||||
|
||||
@@ -407,7 +407,13 @@ export async function executeQuery(
|
||||
sql: string,
|
||||
schema?: string,
|
||||
executionId?: string,
|
||||
options?: { maxRows?: number; fetchSize?: number; pageSize?: number; resultSessionId?: string },
|
||||
options?: {
|
||||
maxRows?: number;
|
||||
fetchSize?: number;
|
||||
pageSize?: number;
|
||||
resultSessionId?: string;
|
||||
clientSessionId?: string;
|
||||
},
|
||||
): Promise<QueryResult> {
|
||||
return post("/api/query/execute", { connectionId, database, sql, schema, executionId, ...options });
|
||||
}
|
||||
@@ -418,13 +424,32 @@ export async function executeMulti(
|
||||
sql: string,
|
||||
schema?: string,
|
||||
executionId?: string,
|
||||
options?: { maxRows?: number; fetchSize?: number; pageSize?: number; resultSessionId?: string },
|
||||
options?: {
|
||||
maxRows?: number;
|
||||
fetchSize?: number;
|
||||
pageSize?: number;
|
||||
resultSessionId?: string;
|
||||
clientSessionId?: string;
|
||||
},
|
||||
): Promise<QueryResult[]> {
|
||||
return post("/api/query/execute-multi", { connectionId, database, sql, schema, executionId, ...options });
|
||||
}
|
||||
|
||||
export async function closeQuerySession(connectionId: string, database: string, sessionId: string): Promise<boolean> {
|
||||
return post("/api/query/close-session", { connectionId, database, sessionId });
|
||||
export async function closeQuerySession(
|
||||
connectionId: string,
|
||||
database: string,
|
||||
sessionId: string,
|
||||
clientSessionId?: string,
|
||||
): Promise<boolean> {
|
||||
return post("/api/query/close-session", { connectionId, database, sessionId, clientSessionId });
|
||||
}
|
||||
|
||||
export async function closeClientConnectionSession(
|
||||
connectionId: string,
|
||||
database: string,
|
||||
clientSessionId: string,
|
||||
): Promise<boolean> {
|
||||
return post("/api/query/close-client-session", { connectionId, database, clientSessionId });
|
||||
}
|
||||
|
||||
export async function executeBatch(
|
||||
|
||||
@@ -361,7 +361,13 @@ export async function executeQuery(
|
||||
sql: string,
|
||||
schema?: string,
|
||||
executionId?: string,
|
||||
options?: { maxRows?: number; fetchSize?: number; pageSize?: number; resultSessionId?: string },
|
||||
options?: {
|
||||
maxRows?: number;
|
||||
fetchSize?: number;
|
||||
pageSize?: number;
|
||||
resultSessionId?: string;
|
||||
clientSessionId?: string;
|
||||
},
|
||||
): Promise<QueryResult> {
|
||||
return invoke("execute_query", { connectionId, database, sql, schema, executionId, ...options });
|
||||
}
|
||||
@@ -372,7 +378,13 @@ export async function executeMulti(
|
||||
sql: string,
|
||||
schema?: string,
|
||||
executionId?: string,
|
||||
options?: { maxRows?: number; fetchSize?: number; pageSize?: number; resultSessionId?: string },
|
||||
options?: {
|
||||
maxRows?: number;
|
||||
fetchSize?: number;
|
||||
pageSize?: number;
|
||||
resultSessionId?: string;
|
||||
clientSessionId?: string;
|
||||
},
|
||||
): Promise<QueryResult[]> {
|
||||
return invoke("execute_multi", { connectionId, database, sql, schema, executionId, ...options });
|
||||
}
|
||||
@@ -381,8 +393,21 @@ export async function cancelQuery(executionId: string): Promise<boolean> {
|
||||
return invoke("cancel_query", { executionId });
|
||||
}
|
||||
|
||||
export async function closeQuerySession(connectionId: string, database: string, sessionId: string): Promise<boolean> {
|
||||
return invoke("close_query_session", { connectionId, database, sessionId });
|
||||
export async function closeQuerySession(
|
||||
connectionId: string,
|
||||
database: string,
|
||||
sessionId: string,
|
||||
clientSessionId?: string,
|
||||
): Promise<boolean> {
|
||||
return invoke("close_query_session", { connectionId, database, sessionId, clientSessionId });
|
||||
}
|
||||
|
||||
export async function closeClientConnectionSession(
|
||||
connectionId: string,
|
||||
database: string,
|
||||
clientSessionId: string,
|
||||
): Promise<boolean> {
|
||||
return invoke("close_client_connection_session", { connectionId, database, clientSessionId });
|
||||
}
|
||||
|
||||
export async function executeBatch(
|
||||
|
||||
Reference in new issue
Block a user