Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
969d73b3
Commit
969d73b3
authored
8 years ago
by
Tom Robinson
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup Query types
parent
daf5d8d0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/metabase/meta/types/Query.js
+51
-61
51 additions, 61 deletions
frontend/src/metabase/meta/types/Query.js
with
51 additions
and
61 deletions
frontend/src/metabase/meta/types/Query.js
+
51
−
61
View file @
969d73b3
...
...
@@ -6,16 +6,18 @@ export type FieldId = number;
export
type
SegmentId
=
number
;
export
type
MetricId
=
number
;
export
type
StringLiteralType
=
string
;
export
type
NumericLiteralType
=
number
;
export
type
DatetimeLiteralType
=
string
;
export
type
ExpressionName
=
string
;
export
type
ValueType
=
null
|
boolean
|
StringLiteralType
|
NumericLiteralType
|
DatetimeLiteralType
;
export
type
OrderableValueType
=
NumericLiteralType
|
DatetimeLiteralType
;
export
type
StringLiteral
=
string
;
export
type
NumericLiteral
=
number
;
export
type
DatetimeLiteral
=
string
;
export
type
RelativeDatetimePeriodType
=
"
current
"
|
"
last
"
|
"
next
"
|
number
;
export
type
RelativeDatetimeUnitType
=
"
minute
"
|
"
hour
"
|
"
day
"
|
"
week
"
|
"
month
"
|
"
quarter
"
|
"
year
"
;
export
type
DatetimeUnitType
=
"
default
"
|
"
minute
"
|
"
minute-of-hour
"
|
"
hour
"
|
"
hour-of-day
"
|
"
day
"
|
"
day-of-week
"
|
"
day-of-month
"
|
"
day-of-year
"
|
"
week
"
|
"
week-of-year
"
|
"
month
"
|
"
month-of-year
"
|
"
quarter
"
|
"
quarter-of-year
"
|
"
year
"
;
export
type
Value
=
null
|
boolean
|
StringLiteral
|
NumericLiteral
|
DatetimeLiteral
;
export
type
OrderableValue
=
NumericLiteral
|
DatetimeLiteral
;
export
type
RelativeDatetimePeriod
=
"
current
"
|
"
last
"
|
"
next
"
|
number
;
export
type
RelativeDatetimeUnit
=
"
minute
"
|
"
hour
"
|
"
day
"
|
"
week
"
|
"
month
"
|
"
quarter
"
|
"
year
"
;
export
type
DatetimeUnit
=
"
default
"
|
"
minute
"
|
"
minute-of-hour
"
|
"
hour
"
|
"
hour-of-day
"
|
"
day
"
|
"
day-of-week
"
|
"
day-of-month
"
|
"
day-of-year
"
|
"
week
"
|
"
week-of-year
"
|
"
month
"
|
"
month-of-year
"
|
"
quarter
"
|
"
quarter-of-year
"
|
"
year
"
;
export
type
NativeQueryObject
=
{
query
:
string
...
...
@@ -23,79 +25,67 @@ export type NativeQueryObject = {
export
type
StructuredQueryObject
=
{
source_table
:
?
TableId
,
aggregation
?:
AggregationClause
Type
,
breakout
?:
BreakoutClause
Type
,
aggregation
?:
AggregationClause
,
breakout
?:
BreakoutClause
,
filter
?:
FilterClause
,
order_by
?:
OrderByClause
Type
,
limit
?:
number
,
expressions
?:
{
[
key
:
string
]:
Expression
Type
}
order_by
?:
OrderByClause
,
limit
?:
LimitClause
,
expressions
?:
{
[
key
:
ExpressionName
]:
Expression
}
};
export
type
AggregationClause
Type
=
export
type
AggregationClause
=
[
"
rows
"
]
|
// deprecated
[
"
avg
"
,
ConcreteFieldType
]
|
[
"
count
"
]
|
[
"
count
"
,
ConcreteFieldType
]
|
[
"
cum_sum
"
,
ConcreteFieldType
]
|
[
"
distinct
"
,
ConcreteFieldType
]
|
[
"
stddev
"
,
ConcreteFieldType
]
|
[
"
sum
"
,
ConcreteFieldType
]
|
[
"
min
"
,
ConcreteFieldType
]
|
[
"
max
"
,
ConcreteFieldType
]
|
[
"
count
"
|
"
avg
"
|
"
cum_sum
"
|
"
distinct
"
|
"
stddev
"
|
"
sum
"
|
"
min
"
|
"
max
"
,
ConcreteField
]
|
[
"
metric
"
,
MetricId
];
export
type
BreakoutClause
Type
=
Array
<
ConcreteField
Type
>
;
export
type
BreakoutClause
=
Array
<
ConcreteField
>
;
export
type
FilterClause
=
[
"
and
"
,
FilterClause
]
|
[
"
or
"
,
FilterClause
]
|
[
"
and
"
|
"
or
"
,
FilterClause
,
FilterClause
]
|
[
"
not
"
,
FilterClause
]
|
[
"
=
"
,
ConcreteFieldType
,
ValueType
]
|
[
"
!=
"
,
ConcreteFieldType
,
ValueType
]
|
[
"
<
"
,
ConcreteFieldType
,
OrderableValueType
]
|
[
"
>
"
,
ConcreteFieldType
,
OrderableValueType
]
|
[
"
<=
"
,
ConcreteFieldType
,
OrderableValueType
]
|
[
"
>=
"
,
ConcreteFieldType
,
OrderableValueType
]
|
[
"
is-null
"
,
ConcreteFieldType
]
|
[
"
not-null
"
,
ConcreteFieldType
]
|
[
"
between
"
,
ConcreteFieldType
,
OrderableValueType
,
OrderableValueType
]
|
[
"
inside
"
,
ConcreteFieldType
,
ConcreteFieldType
,
NumericLiteralType
,
NumericLiteralType
,
NumericLiteralType
,
NumericLiteralType
]
|
[
"
starts-with
"
,
ConcreteFieldType
,
StringLiteralType
]
|
[
"
contains
"
,
ConcreteFieldType
,
StringLiteralType
]
|
[
"
does-not-contain
"
,
ConcreteFieldType
,
StringLiteralType
]
|
[
"
ends-with
"
,
ConcreteFieldType
,
StringLiteralType
]
|
[
"
time-interval
"
,
ConcreteFieldType
,
RelativeDatetimePeriodType
,
RelativeDatetimeUnitType
]
|
[
"
=
"
|
"
!=
"
,
ConcreteField
,
Value
]
|
[
"
<
"
|
"
>
"
|
"
<=
"
|
"
>=
"
,
ConcreteField
,
OrderableValue
]
|
[
"
is-null
"
|
"
not-null
"
,
ConcreteField
]
|
[
"
between
"
,
ConcreteField
,
OrderableValue
,
OrderableValue
]
|
[
"
inside
"
,
ConcreteField
,
ConcreteField
,
NumericLiteral
,
NumericLiteral
,
NumericLiteral
,
NumericLiteral
]
|
[
"
starts-with
"
|
"
contains
"
|
"
does-not-contain
"
|
"
ends-with
"
,
ConcreteField
,
StringLiteral
]
|
[
"
time-interval
"
,
ConcreteField
,
RelativeDatetimePeriod
,
RelativeDatetimeUnit
]
|
[
"
segment
"
,
SegmentId
];
export
type
OrderByClauseType
=
Array
<
OrderByType
>
;
export
type
OrderByType
=
[
"
asc
"
|
"
desc
"
,
FieldType
];
export
type
OrderByClause
=
Array
<
OrderBy
>
;
export
type
OrderBy
=
[
"
asc
"
|
"
desc
"
,
Field
];
export
type
LimitClause
=
number
;
export
type
FieldType
=
ConcreteFieldType
|
ExpressionReferenceType
|
AggregateFieldType
;
export
type
Field
=
ConcreteField
|
AggregateField
;
export
type
ConcreteFieldType
=
LocalFieldReferenceType
|
ForeignFieldReferenceType
|
DatetimeFieldType
;
export
type
ConcreteField
=
LocalFieldReference
|
ForeignFieldReference
|
ExpressionReference
|
DatetimeField
;
export
type
LocalFieldReference
Type
=
export
type
LocalFieldReference
=
[
"
field-id
"
,
FieldId
]
|
FieldId
;
// deprecated
export
type
ForeignFieldReference
Type
=
export
type
ForeignFieldReference
=
[
"
fk->
"
,
FieldId
,
FieldId
];
export
type
DatetimeFieldType
=
[
"
datetime-field
"
,
LocalFieldReferenceType
|
ForeignFieldReferenceType
,
DatetimeUnitType
]
|
[
"
datetime-field
"
,
LocalFieldReferenceType
|
ForeignFieldReferenceType
,
"
as
"
,
DatetimeUnitType
];
// deprecated
export
type
ExpressionReference
=
[
"
expression
"
,
ExpressionName
];
export
type
ExpressionReferenceType
=
[
"
expression
"
,
string
];
export
type
DatetimeField
=
[
"
datetime-field
"
,
LocalFieldReference
|
ForeignFieldReference
,
DatetimeUnit
]
|
[
"
datetime-field
"
,
LocalFieldReference
|
ForeignFieldReference
,
"
as
"
,
DatetimeUnit
];
// deprecated
export
type
AggregateField
Type
=
[
"
aggregation
"
,
number
];
export
type
AggregateField
=
[
"
aggregation
"
,
number
];
export
type
Expression
Binary
Operator
Type
=
"
+
"
|
"
-
"
|
"
*
"
|
"
/
"
;
export
type
Expression
ArgumentType
=
ConcreteField
Type
|
NumericLiteral
Type
;
export
type
ExpressionOperator
=
"
+
"
|
"
-
"
|
"
*
"
|
"
/
"
;
export
type
Expression
Operand
=
ConcreteField
|
NumericLiteral
|
Expression
;
export
type
Expression
Type
=
[
Expression
Binary
Operator
Type
,
Expression
ArgumentType
,
ExpressionArgumentType
];
export
type
Expression
=
[
ExpressionOperator
,
Expression
Operand
,
ExpressionOperand
];
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment