Mercurial > urweb
comparison src/mysql.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 | ad434669f299 |
children | d9483301ff0e |
comparison
equal
deleted
inserted
replaced
1010:6b0f3853cc81 | 1011:16f7cb0891b6 |
---|---|
34 fun p_sql_type t = | 34 fun p_sql_type t = |
35 case t of | 35 case t of |
36 Int => "bigint" | 36 Int => "bigint" |
37 | Float => "double" | 37 | Float => "double" |
38 | String => "longtext" | 38 | String => "longtext" |
39 | Char => "char" | |
39 | Bool => "bool" | 40 | Bool => "bool" |
40 | Time => "timestamp" | 41 | Time => "timestamp" |
41 | Blob => "longblob" | 42 | Blob => "longblob" |
42 | Channel => "bigint" | 43 | Channel => "bigint" |
43 | Client => "int" | 44 | Client => "int" |
46 fun p_buffer_type t = | 47 fun p_buffer_type t = |
47 case t of | 48 case t of |
48 Int => "MYSQL_TYPE_LONGLONG" | 49 Int => "MYSQL_TYPE_LONGLONG" |
49 | Float => "MYSQL_TYPE_DOUBLE" | 50 | Float => "MYSQL_TYPE_DOUBLE" |
50 | String => "MYSQL_TYPE_STRING" | 51 | String => "MYSQL_TYPE_STRING" |
52 | Char => "MYSQL_TYPE_TINY" | |
51 | Bool => "MYSQL_TYPE_LONG" | 53 | Bool => "MYSQL_TYPE_LONG" |
52 | Time => "MYSQL_TYPE_TIMESTAMP" | 54 | Time => "MYSQL_TYPE_TIMESTAMP" |
53 | Blob => "MYSQL_TYPE_BLOB" | 55 | Blob => "MYSQL_TYPE_BLOB" |
54 | Channel => "MYSQL_TYPE_LONGLONG" | 56 | Channel => "MYSQL_TYPE_LONGLONG" |
55 | Client => "MYSQL_TYPE_LONG" | 57 | Client => "MYSQL_TYPE_LONG" |
58 fun p_sql_type_base t = | 60 fun p_sql_type_base t = |
59 case t of | 61 case t of |
60 Int => "bigint" | 62 Int => "bigint" |
61 | Float => "double" | 63 | Float => "double" |
62 | String => "longtext" | 64 | String => "longtext" |
65 | Char => "char" | |
63 | Bool => "tinyint" | 66 | Bool => "tinyint" |
64 | Time => "timestamp" | 67 | Time => "timestamp" |
65 | Blob => "longblob" | 68 | Blob => "longblob" |
66 | Channel => "bigint" | 69 | Channel => "bigint" |
67 | Client => "int" | 70 | Client => "int" |
383 string "uw_sqlfmtFloat = \"%g%n\";", | 386 string "uw_sqlfmtFloat = \"%g%n\";", |
384 newline, | 387 newline, |
385 string "uw_Estrings = 0;", | 388 string "uw_Estrings = 0;", |
386 newline, | 389 newline, |
387 string "uw_sqlsuffixString = \"\";", | 390 string "uw_sqlsuffixString = \"\";", |
391 newline, | |
392 string "uw_sqlsuffixChar = \"\";", | |
388 newline, | 393 newline, |
389 string "uw_sqlsuffixBlob = \"\";", | 394 string "uw_sqlsuffixBlob = \"\";", |
390 newline, | 395 newline, |
391 string "uw_sqlfmtUint4 = \"%u%n\";", | 396 string "uw_sqlfmtUint4 = \"%u%n\";", |
392 newline, | 397 newline, |