comparison src/mysql.sml @ 867:e7f80d78075b

Moved query code into Settings
author Adam Chlipala <adamc@hcoop.net>
date Sun, 28 Jun 2009 16:03:00 -0400
parents 03e7f111fe99
children 06497beb265b
comparison
equal deleted inserted replaced
866:03e7f111fe99 867:e7f80d78075b
184 string "uw_error(ctx, BOUNDED_RETRY, ", 184 string "uw_error(ctx, BOUNDED_RETRY, ",
185 string "\"Connection to MySQL server failed: %s\", msg);"], 185 string "\"Connection to MySQL server failed: %s\", msg);"],
186 newline, 186 newline,
187 string "}", 187 string "}",
188 newline, 188 newline,
189 string "conn = malloc(sizeof(conn));", 189 string "conn = calloc(1, sizeof(conn));",
190 newline, 190 newline,
191 string "conn->conn = mysql;", 191 string "conn->conn = mysql;",
192 newline, 192 newline,
193 string "uw_set_db(ctx, conn);", 193 string "uw_set_db(ctx, conn);",
194 newline, 194 newline,
250 newline, 250 newline,
251 string "}", 251 string "}",
252 newline, 252 newline,
253 newline] 253 newline]
254 end 254 end
255
256 fun query _ = raise Fail "MySQL query"
257 fun queryPrepared _ = raise Fail "MySQL queryPrepared"
255 258
256 val () = addDbms {name = "mysql", 259 val () = addDbms {name = "mysql",
257 header = "mysql/mysql.h", 260 header = "mysql/mysql.h",
258 link = "-lmysqlclient", 261 link = "-lmysqlclient",
259 global_init = box [string "void uw_client_init() {", 262 global_init = box [string "void uw_client_init() {",
266 newline], 269 newline],
267 string "}", 270 string "}",
268 newline], 271 newline],
269 string "}", 272 string "}",
270 newline], 273 newline],
271 init = init} 274 init = init,
275 query = query,
276 queryPrepared = queryPrepared}
272 277
273 end 278 end