Skip to content

Commit

Permalink
fix: use literals; flow does not understand string reference
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Jul 8, 2019
1 parent 8dc9c8b commit 2e5a776
Showing 1 changed file with 14 additions and 27 deletions.
41 changes: 14 additions & 27 deletions src/types.js
Expand Up @@ -8,19 +8,6 @@ import type {
import type {
LoggerType
} from 'roarr';
import {
ArrayTokenSymbol,
ComparisonPredicateTokenSymbol,
IdentifierListTokenSymbol,
IdentifierTokenSymbol,
JsonTokenSymbol,
RawSqlTokenSymbol,
SqlTokenSymbol,
TupleListTokenSymbol,
TupleTokenSymbol,
UnnestTokenSymbol,
ValueListTokenSymbol
} from './symbols';

export type {
LoggerType
Expand Down Expand Up @@ -230,7 +217,7 @@ export type NamedParameterValuesType = {

export type IdentifierTokenType = {|
+names: $ReadOnlyArray<string>,
+type: IdentifierTokenSymbol
+type: 'SLONIK_IDENTIFIER'
|};

export type IdentifierListMemberType = $ReadOnlyArray<string> |
Expand All @@ -241,69 +228,69 @@ export type IdentifierListMemberType = $ReadOnlyArray<string> |

export type IdentifierListTokenType = {|
+identifiers: $ReadOnlyArray<IdentifierListMemberType>,
+type: IdentifierListTokenSymbol
+type: 'SLONIK_IDENTIFIER_LIST'
|};

export type SqlSqlTokenType = {|
+sql: string,
+type: SqlTokenSymbol,
+type: 'SLONIK_SQL',
+values: $ReadOnlyArray<PrimitiveValueExpressionType>
|};

export type RawSqlTokenType = {|
+sql: string,
+type: RawSqlTokenSymbol,
+type: 'SLONIK_RAW_SQL',
+values: PositionalParameterValuesType | NamedParameterValuesType
|};

export type ValueListSqlTokenType = {|
+values: PositionalParameterValuesType,
+type: ValueListTokenSymbol
+type: 'SLONIK_VALUE_LIST'
|};

export type ArraySqlTokenType = {|
+memberType: string,
+type: ArrayTokenSymbol,
+type: 'SLONIK_ARRAY',
+values: PositionalParameterValuesType
|};

export type TupleSqlTokenType = {|
+values: PositionalParameterValuesType,
+type: TupleTokenSymbol
+type: 'SLONIK_TUPLE'
|};

export type TupleListSqlTokenType = {|
+tuples: $ReadOnlyArray<PositionalParameterValuesType>,
+type: TupleListTokenSymbol
+type: 'SLONIK_TUPLE_LIST'
|};

export type UnnestSqlTokenType = {|
+columnTypes: $ReadOnlyArray<string>,
+tuples: $ReadOnlyArray<PositionalParameterValuesType>,
+type: UnnestTokenSymbol
+type: 'SLONIK_UNNEST'
|};

export type ComparisonPredicateTokenType = {|
+leftOperand: ValueExpressionType,
+operator: ComparisonOperatorType,
+rightOperand: ValueExpressionType,
+type: ComparisonPredicateTokenSymbol
+type: 'SLONIK_COMPARISON_PREDICATE'
|};

export type BooleanExpressionTokenType = {|
+members: $ReadOnlyArray<ValueExpressionType>,
+operator: LogicalBooleanOperatorType,
+type: ComparisonPredicateTokenSymbol
+type: 'SLONIK_BOOLEAN_EXPRESSION'
|};

export type AssignmentListTokenType = {|
+namedAssignment: NamedAssignmentType,
+type: ComparisonPredicateTokenSymbol
+type: 'SLONIK_ASSIGNMENT_LIST'
|};

export type JsonSqlTokenType = {|
+value: SerializableValueType,
+type: JsonTokenSymbol
+type: 'SLONIK_JSON'
|};

export type PrimitiveValueExpressionType = $ReadOnlyArray<PrimitiveValueExpressionType> | string | number | boolean | null;
Expand Down Expand Up @@ -333,7 +320,7 @@ export type NamedAssignmentType = {

export type TaggedTemplateLiteralInvocationType = {|
+sql: string,
+type: SqlTokenSymbol,
+type: 'SLONIK_SQL',
+values: $ReadOnlyArray<PrimitiveValueExpressionType>
|};

Expand Down

0 comments on commit 2e5a776

Please sign in to comment.