Mercurial > urweb
comparison src/cjr_print.sml @ 1011:16f7cb0891b6
Initial support for char in SQL
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 22 Oct 2009 16:15:56 -0400 |
parents | 166ea3944b91 |
children | e46227efcbba |
comparison
equal
deleted
inserted
replaced
1010:6b0f3853cc81 | 1011:16f7cb0891b6 |
---|---|
489 fun isFile (t : typ) = | 489 fun isFile (t : typ) = |
490 case #1 t of | 490 case #1 t of |
491 TFfi ("Basis", "file") => true | 491 TFfi ("Basis", "file") => true |
492 | _ => false | 492 | _ => false |
493 | 493 |
494 fun p_sql_type' t = | 494 fun p_sql_type t = string (Settings.p_sql_ctype t) |
495 case t of | |
496 Int => "uw_Basis_int" | |
497 | Float => "uw_Basis_float" | |
498 | String => "uw_Basis_string" | |
499 | Bool => "uw_Basis_bool" | |
500 | Time => "uw_Basis_time" | |
501 | Blob => "uw_Basis_blob" | |
502 | Channel => "uw_Basis_channel" | |
503 | Client => "uw_Basis_client" | |
504 | Nullable String => "uw_Basis_string" | |
505 | Nullable t => p_sql_type' t ^ "*" | |
506 | |
507 fun p_sql_type t = string (p_sql_type' t) | |
508 | 495 |
509 fun getPargs (e, _) = | 496 fun getPargs (e, _) = |
510 case e of | 497 case e of |
511 EPrim (Prim.String _) => [] | 498 EPrim (Prim.String _) => [] |
512 | EFfiApp ("Basis", "strcat", [e1, e2]) => getPargs e1 @ getPargs e2 | 499 | EFfiApp ("Basis", "strcat", [e1, e2]) => getPargs e1 @ getPargs e2 |
1306 fun sql_type_in env (tAll as (t, loc)) = | 1293 fun sql_type_in env (tAll as (t, loc)) = |
1307 case t of | 1294 case t of |
1308 TFfi ("Basis", "int") => Int | 1295 TFfi ("Basis", "int") => Int |
1309 | TFfi ("Basis", "float") => Float | 1296 | TFfi ("Basis", "float") => Float |
1310 | TFfi ("Basis", "string") => String | 1297 | TFfi ("Basis", "string") => String |
1298 | TFfi ("Basis", "char") => Char | |
1311 | TFfi ("Basis", "bool") => Bool | 1299 | TFfi ("Basis", "bool") => Bool |
1312 | TFfi ("Basis", "time") => Time | 1300 | TFfi ("Basis", "time") => Time |
1313 | TFfi ("Basis", "blob") => Blob | 1301 | TFfi ("Basis", "blob") => Blob |
1314 | TFfi ("Basis", "channel") => Channel | 1302 | TFfi ("Basis", "channel") => Channel |
1315 | TFfi ("Basis", "client") => Client | 1303 | TFfi ("Basis", "client") => Client |