db4
Doug Coleman 2008-04-15 21:55:26 -05:00
parent 9140e3e452
commit defc1cfae9
2 changed files with 18 additions and 18 deletions

View File

@ -28,7 +28,7 @@ TUPLE: person name age ;
{ select { select
{ columns "salary" } { columns "salary" }
{ from "staff" } { from "staff" }
{ where { "branchno" "b003" } } { where { "branchno" = "b003" } }
} }
} }
{ "branchno" > 3 } } { "branchno" > 3 } }

View File

@ -27,23 +27,23 @@ DEFER: sql%
: sql-array% ( array -- ) : sql-array% ( array -- )
unclip unclip
{ {
{ columns [ "," (sql-interleave) ] } { \ columns [ "," (sql-interleave) ] }
{ from [ "from" "," sql-interleave ] } { \ from [ "from" "," sql-interleave ] }
{ where [ "where" "and" sql-interleave ] } { \ where [ "where" "and" sql-interleave ] }
{ group-by [ "group by" "," sql-interleave ] } { \ group-by [ "group by" "," sql-interleave ] }
{ having [ "having" "," sql-interleave ] } { \ having [ "having" "," sql-interleave ] }
{ order-by [ "order by" "," sql-interleave ] } { \ order-by [ "order by" "," sql-interleave ] }
{ offset [ "offset" sql% sql% ] } { \ offset [ "offset" sql% sql% ] }
{ limit [ "limit" sql% sql% ] } { \ limit [ "limit" sql% sql% ] }
{ select [ "(select" sql% sql% ")" sql% ] } { \ select [ "(select" sql% sql% ")" sql% ] }
{ table [ sql% ] } { \ table [ sql% ] }
{ set [ "set" "," sql-interleave ] } { \ set [ "set" "," sql-interleave ] }
{ values [ "values(" sql% "," (sql-interleave) ")" sql% ] } { \ values [ break "values(" sql% "," (sql-interleave) ")" sql% ] }
{ count [ "count" sql-function, ] } { \ count [ "count" sql-function, ] }
{ sum [ "sum" sql-function, ] } { \ sum [ "sum" sql-function, ] }
{ avg [ "avg" sql-function, ] } { \ avg [ "avg" sql-function, ] }
{ min [ "min" sql-function, ] } { \ min [ "min" sql-function, ] }
{ max [ "max" sql-function, ] } { \ max [ "max" sql-function, ] }
[ sql% [ sql% ] each ] [ sql% [ sql% ] each ]
} case ; } case ;