-
Notifications
You must be signed in to change notification settings - Fork 39
Updating code generating scripts
All the scripts and input files can be found in Swift-Kuery/Scripts.
The file runScripts.h contains the script to run all the code generating scripts for Swift-Kuery. Add a new script here in order to run it with:
$ Scripts/runScripts.h
-
simpleOperators.shgenerates global operators for simple conditions (listed inSimpleOperators.txt) that return Filter and Having clauses. The fileFilterAndHavingTypes.txtcontains the list of all the types: each line is (Filter/Having, LHS type, RHS type) - the rest is ignored. A special case here is Bool, that can be used only for equals/not equals operators, therefore, there are different input files for Bool:FilterAndHavingBoolOperators.txtandFilterAndHavingBoolTypes.txt. The generated code is inSources/SwiftKuery/FilterAndHaving_GlobalFunctions.swift. -
columnExtensions.shgenerates extensions for Column, ScalarColumnExpression and AggregateColumnExpression for (NOT)LIKE, (NOT)BETWEEN, and (NOT)IN operators. The pairs of (Filter/Having, type to extend) are inColumnExtensionClauses.txt. The fileColumnExtensionOperands.txtcontains the types of the operands for (NOT)BETWEEN, and (NOT)IN operators. The generated code is inSources/SwiftKuery/ColumnAndExpressions_Extensions.swift. -
specialOperators.shcontains the code for the same operators ascolumnExtensions.sh(i.e., (NOT)LIKE, (NOT)BETWEEN, and (NOT)IN), but the generated extensions are for Int, Double, String, Bool, Float and Parameter (listed inColumnExtensionOperands.txt). The generated code is inSources/SwiftKuery/SpecialOperators_Extensions.swift. -
subqueries.shgenerates global operators with subqueries (i.e. 'expression operator ANY/ALL(subquery)'), and extensions for (NOT)IN operator with a subquery. The operators are listed inSimpleOperators.txt. The types for the operators are inSubqueriesTypes.txtas (Filter/Having, LHS type (the type of the expression), RHS type (a Filter/HavingPredicate for ANY or ALL applied on a subquery). For (NOT)IN operator types we useInSelectTypes.txt. The resulting generated code is inSources/SwiftKuery/Subqueries_GlobalFunctionsAndExtensions.swift. -
filterAndHavingExtensions.shgenerates extensions for Filter and Having for IS (NOT) NULL operators. The generated code is in FilterAndHaving_Extensions.swift -
The following scripts generate tests:
-
testSimpleOperators.shtests the code generated bysimpleOperators.shusing the same input files. The generated test is TestFilterAndHaving.swift. -
testAggregate.shtests aggregate functions. It creates TestAggregateFunctions.swift. -
testSpecialOperators.shtests the code generated byspecialOperators.shusing the same input files. The generated test is TestSpecialOperators.swift. -
testSubqueries.shtests the code generated bysubqueries.shusing the same input files. The generated test is TestSubqueries.swift.
-