Skip to content

Commit

Permalink
New BQL keywords and bug fixes (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
akshaisarma authored May 18, 2021
1 parent 242f0cc commit a7e9a76
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
5 changes: 4 additions & 1 deletion app/components/schema-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ export default class SchemaTableComponent extends PaginatedTable {
this.table = Table.create({ columns: this.columns });
if (!this.args.isNested) {
this.sortBy('name', 'ascending');
this.addPages(2);
} else {
// Add everything if nested
this.addRows(0, this.numberOfRows);
}
this.addPages(2);
}

static fieldsToRows(fields) {
Expand Down
14 changes: 10 additions & 4 deletions app/utils/builder-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,12 +447,18 @@ export function addQueryBuilderRules(element, rules, bql) {
* @param {function} validateHook The hook to invoke for validation when something changes in the QueryBuilder.
*/
export function addQueryBuilderHooks(element, context, dirtyHook, validateHook) {
element.on('rulesChanged.queryBuilder', bind(context, dirtyHook));
let event = [
let subFieldChanged = 'afterUpdateRuleSubfield.queryBuilder';
let dirtyEvents = [
'rulesChanged.queryBuilder',
subFieldChanged
];
element.on(dirtyEvents.join(' '), bind(context, dirtyHook));

let validateEvents = [
'afterUpdateRuleFilter.queryBuilder',
'afterUpdateRuleOperator.queryBuilder',
'afterUpdateRuleSubfield.queryBuilder',
subFieldChanged,
'afterUpdateRuleValue.queryBuilder'
];
element.on(event.join(' '), bind(context, validateHook));
element.on(validateEvents.join(' '), bind(context, validateHook));
}
5 changes: 3 additions & 2 deletions app/utils/codemirror-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ export function defineBQL() {
name: 'sql',
keywords: set('select as cast count distinct sum min max avg from where if and or not xor is all any true false ' +
'null group by having order asc desc limit every first time record linear region manual stream ' +
'windowing tumbling quantile freq cumfreq top sizeis sizeof filter rlike containskey containsvalue'),
'windowing tumbling quantile freq cumfreq top sizeis sizeof filter rlike containskey containsvalue ' +
'lateral view outer explode trim abs between substr substring unixtimestamp'),
builtin: set('string boolean integer long float double map list'),
atoms: set('false true null'),
operatorChars: /^[*+\-/%<>!=&|^]/,
dateSQL: { },
support: set('zerolessFloat doubleQuote commentHash commentSlashSlash')
support: set('ODBCdotTable zerolessFloat doubleQuote commentHash commentSlashSlash')
});
}

Expand Down

0 comments on commit a7e9a76

Please sign in to comment.