comparison src/cjr_print.sml @ 438:1c27f03d9bd2

Reading timestamps from SQL
author Adam Chlipala <adamc@hcoop.net>
date Thu, 30 Oct 2008 14:57:15 -0400
parents 659c17441250
children 322c8620bbdf
comparison
equal deleted inserted replaced
437:1a4c1b5f4d8f 438:1c27f03d9bd2
401 if wontLeakStrings then 401 if wontLeakStrings then
402 e 402 e
403 else 403 else
404 box [string "uw_Basis_strdup(ctx, ", e, string ")"] 404 box [string "uw_Basis_strdup(ctx, ", e, string ")"]
405 | TFfi ("Basis", "bool") => box [string "uw_Basis_stringToBool_error(ctx, ", e, string ")"] 405 | TFfi ("Basis", "bool") => box [string "uw_Basis_stringToBool_error(ctx, ", e, string ")"]
406 | TFfi ("Basis", "time") => box [string "uw_Basis_stringToTime_error(ctx, ", e, string ")"]
406 | _ => (ErrorMsg.errorAt loc "Don't know how to unmarshal type from SQL"; 407 | _ => (ErrorMsg.errorAt loc "Don't know how to unmarshal type from SQL";
407 Print.eprefaces' [("Type", p_typ env tAll)]; 408 Print.eprefaces' [("Type", p_typ env tAll)];
408 string "ERROR") 409 string "ERROR")
409 410
410 datatype sql_type = 411 datatype sql_type =
1393 case t of 1394 case t of
1394 TFfi ("Basis", "int") => "int8" 1395 TFfi ("Basis", "int") => "int8"
1395 | TFfi ("Basis", "float") => "float8" 1396 | TFfi ("Basis", "float") => "float8"
1396 | TFfi ("Basis", "string") => "text" 1397 | TFfi ("Basis", "string") => "text"
1397 | TFfi ("Basis", "bool") => "bool" 1398 | TFfi ("Basis", "bool") => "bool"
1399 | TFfi ("Basis", "time") => "timestamp"
1398 | _ => (ErrorMsg.errorAt loc "Don't know SQL equivalent of type"; 1400 | _ => (ErrorMsg.errorAt loc "Don't know SQL equivalent of type";
1399 Print.eprefaces' [("Type", p_typ env tAll)]; 1401 Print.eprefaces' [("Type", p_typ env tAll)];
1400 "ERROR") 1402 "ERROR")
1401 1403
1402 fun p_sqltype env t = string (p_sqltype' env t) 1404 fun p_sqltype env t = string (p_sqltype' env t)