@@ -83,7 +83,7 @@ module SqlGen =
8383 | Abs, _ -> ValueSome " ABS"
8484
8585 | Length, Sqlite -> ValueSome " LENGTH"
86- | Length, Postgres -> ValueSome " CHAR_LENGTH "
86+ | Length, Postgres
8787 | Length, MySql -> ValueSome " CHAR_LENGTH"
8888 | Length, Generic -> ValueSome " LENGTH"
8989
@@ -93,7 +93,7 @@ module SqlGen =
9393
9494 | IndexOf, Postgres -> ValueSome " STRPOS"
9595 | IndexOf, MySql -> ValueSome " LOCATE"
96- | IndexOf, Sqlite -> ValueSome " INSTR "
96+ | IndexOf, Sqlite
9797 | IndexOf, Generic -> ValueSome " INSTR"
9898
9999 // Every engine's plain-rounding function has the same name.
@@ -117,6 +117,22 @@ module SqlGen =
117117 | Second -> ValueSome( " SECOND" , " %S" )
118118 | _ -> ValueNone
119119
120+ /// The one argument of a single-argument function.
121+ let private oneArg ( fn : SqlFn ) ( args : SqlExpr list ) : SqlExpr =
122+ match args with
123+ | [ single ] -> single
124+ | _ -> failwith ( " SqlGen: " + string fn + " takes exactly one argument" )
125+
126+ let private twoArgs ( fn : SqlFn ) ( args : SqlExpr list ) : SqlExpr * SqlExpr =
127+ match args with
128+ | [ first; second ] -> first, second
129+ | _ -> failwith ( " SqlGen: " + string fn + " takes exactly two arguments" )
130+
131+ /// ` .Date ` . SQLite and MySQL have DATE(); PostgreSQL's DATE() is not the
132+ /// same thing, so it uses the truncation SQLProvider uses too.
133+
134+ /// The two arguments of a two-argument function.
135+
120136 let rec private renderExpr ( b : Builder ) ( e : SqlExpr ) =
121137 let append ( s : string ) = write b s
122138
@@ -269,20 +285,6 @@ module SqlGen =
269285 // tree loses its bindings (the G25 family) -- and small single-scrutinee
270286 // matches are what it compiles correctly.
271287
272- /// The one argument of a single-argument function.
273- and private oneArg ( fn : SqlFn ) ( args : SqlExpr list ) : SqlExpr =
274- match args with
275- | [ single ] -> single
276- | _ -> failwith ( " SqlGen: " + string fn + " takes exactly one argument" )
277-
278- /// The two arguments of a two-argument function.
279- and private twoArgs ( fn : SqlFn ) ( args : SqlExpr list ) : SqlExpr * SqlExpr =
280- match args with
281- | [ first; second ] -> first, second
282- | _ -> failwith ( " SqlGen: " + string fn + " takes exactly two arguments" )
283-
284- /// ` .Date ` . SQLite and MySQL have DATE(); PostgreSQL's DATE() is not the
285- /// same thing, so it uses the truncation SQLProvider uses too.
286288 and private renderDateOnly ( b : Builder ) ( arg : SqlExpr ) =
287289 let append ( s : string ) = write b s
288290
0 commit comments