comparison src/mysql.sml @ 1094:db52c32dbe42

All three current protocols work with move to using uw_app
author Adam Chlipala <adamc@hcoop.net>
date Sun, 27 Dec 2009 10:37:24 -0500
parents b2311dfb3158
children 134da5110bf7
comparison
equal deleted inserted replaced
1093:8d3aa6c7cee0 1094:db52c32dbe42
377 ss], 377 ss],
378 string "} uw_conn;", 378 string "} uw_conn;",
379 newline, 379 newline,
380 newline, 380 newline,
381 381
382 string "void uw_client_init(void) {", 382 string "static void uw_client_init(void) {",
383 newline, 383 newline,
384 box [string "uw_sqlfmtInt = \"%lld%n\";", 384 box [string "uw_sqlfmtInt = \"%lld%n\";",
385 newline, 385 newline,
386 string "uw_sqlfmtFloat = \"%g%n\";", 386 string "uw_sqlfmtFloat = \"%g%n\";",
387 newline, 387 newline,
500 newline, 500 newline,
501 string "static void uw_db_validate(uw_context ctx) { }"], 501 string "static void uw_db_validate(uw_context ctx) { }"],
502 newline, 502 newline,
503 newline, 503 newline,
504 504
505 string "void uw_db_init(uw_context ctx) {", 505 string "static void uw_db_init(uw_context ctx) {",
506 newline, 506 newline,
507 string "MYSQL *mysql = mysql_init(NULL);", 507 string "MYSQL *mysql = mysql_init(NULL);",
508 newline, 508 newline,
509 string "uw_conn *conn;", 509 string "uw_conn *conn;",
510 newline, 510 newline,
552 newline, 552 newline,
553 string "}", 553 string "}",
554 newline, 554 newline,
555 newline, 555 newline,
556 556
557 string "void uw_db_close(uw_context ctx) {", 557 string "static void uw_db_close(uw_context ctx) {",
558 newline, 558 newline,
559 string "uw_conn *conn = uw_get_db(ctx);", 559 string "uw_conn *conn = uw_get_db(ctx);",
560 newline, 560 newline,
561 p_list_sepi (box []) 561 p_list_sepi (box [])
562 (fn i => fn _ => 562 (fn i => fn _ =>
571 newline, 571 newline,
572 string "}", 572 string "}",
573 newline, 573 newline,
574 newline, 574 newline,
575 575
576 string "int uw_db_begin(uw_context ctx) {", 576 string "static int uw_db_begin(uw_context ctx) {",
577 newline, 577 newline,
578 string "uw_conn *conn = uw_get_db(ctx);", 578 string "uw_conn *conn = uw_get_db(ctx);",
579 newline, 579 newline,
580 newline, 580 newline,
581 string "return mysql_query(conn->conn, \"SET TRANSACTION ISOLATION LEVEL SERIALIZABLE\")", 581 string "return mysql_query(conn->conn, \"SET TRANSACTION ISOLATION LEVEL SERIALIZABLE\")",
584 newline, 584 newline,
585 string "}", 585 string "}",
586 newline, 586 newline,
587 newline, 587 newline,
588 588
589 string "int uw_db_commit(uw_context ctx) {", 589 string "static int uw_db_commit(uw_context ctx) {",
590 newline, 590 newline,
591 string "uw_conn *conn = uw_get_db(ctx);", 591 string "uw_conn *conn = uw_get_db(ctx);",
592 newline, 592 newline,
593 string "return mysql_commit(conn->conn);", 593 string "return mysql_commit(conn->conn);",
594 newline, 594 newline,
595 string "}", 595 string "}",
596 newline, 596 newline,
597 newline, 597 newline,
598 598
599 string "int uw_db_rollback(uw_context ctx) {", 599 string "static int uw_db_rollback(uw_context ctx) {",
600 newline, 600 newline,
601 string "uw_conn *conn = uw_get_db(ctx);", 601 string "uw_conn *conn = uw_get_db(ctx);",
602 newline, 602 newline,
603 string "return mysql_rollback(conn->conn);", 603 string "return mysql_rollback(conn->conn);",
604 newline, 604 newline,