mirror of
https://github.com/apache/superset.git
synced 2026-04-20 08:34:37 +00:00
Add separate limit setting for SqlLab (#4941)
* Add separate limit setting for SqlLab Use separate param for wrap sql Get query limit from config unit tests for limit control rendering in sql editor py unit test pg tests Add max rows limit Remove concept of infinity, always require defined limits consistency Assert on validation errors instead of tooltip fix unit tests attempt persist state pr comments and linting * load configs in via common param * default to 1k
This commit is contained in:
@@ -27,6 +27,7 @@ export const QUERY_EDITOR_SET_SCHEMA = 'QUERY_EDITOR_SET_SCHEMA';
|
||||
export const QUERY_EDITOR_SET_TITLE = 'QUERY_EDITOR_SET_TITLE';
|
||||
export const QUERY_EDITOR_SET_AUTORUN = 'QUERY_EDITOR_SET_AUTORUN';
|
||||
export const QUERY_EDITOR_SET_SQL = 'QUERY_EDITOR_SET_SQL';
|
||||
export const QUERY_EDITOR_SET_QUERY_LIMIT = 'QUERY_EDITOR_SET_QUERY_LIMIT';
|
||||
export const QUERY_EDITOR_SET_TEMPLATE_PARAMS = 'QUERY_EDITOR_SET_TEMPLATE_PARAMS';
|
||||
export const QUERY_EDITOR_SET_SELECTED_TEXT = 'QUERY_EDITOR_SET_SELECTED_TEXT';
|
||||
export const QUERY_EDITOR_PERSIST_HEIGHT = 'QUERY_EDITOR_PERSIST_HEIGHT';
|
||||
@@ -141,6 +142,7 @@ export function runQuery(query) {
|
||||
tmp_table_name: query.tempTableName,
|
||||
select_as_cta: query.ctas,
|
||||
templateParams: query.templateParams,
|
||||
queryLimit: query.queryLimit,
|
||||
};
|
||||
|
||||
return SupersetClient.post({
|
||||
@@ -230,6 +232,10 @@ export function queryEditorSetSql(queryEditor, sql) {
|
||||
return { type: QUERY_EDITOR_SET_SQL, queryEditor, sql };
|
||||
}
|
||||
|
||||
export function queryEditorSetQueryLimit(queryEditor, queryLimit) {
|
||||
return { type: QUERY_EDITOR_SET_QUERY_LIMIT, queryEditor, queryLimit };
|
||||
}
|
||||
|
||||
export function queryEditorSetTemplateParams(queryEditor, templateParams) {
|
||||
return { type: QUERY_EDITOR_SET_TEMPLATE_PARAMS, queryEditor, templateParams };
|
||||
}
|
||||
@@ -325,6 +331,7 @@ export function reFetchQueryResults(query) {
|
||||
tab: '',
|
||||
runAsync: false,
|
||||
ctas: false,
|
||||
queryLimit: query.queryLimit,
|
||||
};
|
||||
dispatch(runQuery(newQuery));
|
||||
dispatch(changeDataPreviewId(query.id, newQuery));
|
||||
|
||||
Reference in New Issue
Block a user