Mercurial > urweb
comparison src/sqlite.sml @ 890:034eeb099564
Blobs tested in MySQL and SQLite
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 18 Jul 2009 10:27:32 -0400 |
parents | 9eb479691d1c |
children | 16f7cb0891b6 |
comparison
equal
deleted
inserted
replaced
889:bcad392e288e | 890:034eeb099564 |
---|---|
372 box [string "uw_strdup(ctx, sqlite3_column_text(stmt, ", string (Int.toString i), string "))"] | 372 box [string "uw_strdup(ctx, sqlite3_column_text(stmt, ", string (Int.toString i), string "))"] |
373 | Bool => box [string "(uw_Basis_bool)sqlite3_column_int(stmt, ", string (Int.toString i), string ")"] | 373 | Bool => box [string "(uw_Basis_bool)sqlite3_column_int(stmt, ", string (Int.toString i), string ")"] |
374 | Time => box [string "uw_Basis_stringToTime_error(ctx, sqlite3_column_text(stmt, ", string (Int.toString i), string "))"] | 374 | Time => box [string "uw_Basis_stringToTime_error(ctx, sqlite3_column_text(stmt, ", string (Int.toString i), string "))"] |
375 | Blob => box [string "({", | 375 | Blob => box [string "({", |
376 newline, | 376 newline, |
377 string "char *data = sqlite3_column_blob(stmt, ", | 377 string "char *data = (char *)sqlite3_column_blob(stmt, ", |
378 string (Int.toString i), | 378 string (Int.toString i), |
379 string ");", | 379 string ");", |
380 newline, | 380 newline, |
381 string "uw_Basis_blob b = {sqlite3_column_bytes(stmt, ", | 381 string "int len = sqlite3_column_bytes(stmt, ", |
382 string (Int.toString i), | 382 string (Int.toString i), |
383 string "), data};", | 383 string ");", |
384 newline, | |
385 string "uw_Basis_blob b = {len, uw_memdup(ctx, data, len)};", | |
384 newline, | 386 newline, |
385 string "b;", | 387 string "b;", |
386 newline, | 388 newline, |
387 string "})"] | 389 string "})"] |
388 | Channel => box [string "({", | 390 | Channel => box [string "({", |
535 string (Int.toString (i + 1)), | 537 string (Int.toString (i + 1)), |
536 string ", ", | 538 string ", ", |
537 arg, | 539 arg, |
538 string ".data, ", | 540 string ".data, ", |
539 arg, | 541 arg, |
540 string ".size, SQLITE_TRANSIENT"] | 542 string ".size, SQLITE_TRANSIENT)"] |
541 | Channel => box [string "sqlite3_bind_int64(stmt, ", | 543 | Channel => box [string "sqlite3_bind_int64(stmt, ", |
542 string (Int.toString (i + 1)), | 544 string (Int.toString (i + 1)), |
543 string ", ((sqlite3_int64)", | 545 string ", ((sqlite3_int64)", |
544 arg, | 546 arg, |
545 string ".cli << 32) | ", | 547 string ".cli << 32) | ", |
765 supportsUpdateAs = false, | 767 supportsUpdateAs = false, |
766 createSequence = fn s => "CREATE TABLE " ^ s ^ " (id INTEGER PRIMARY KEY AUTOINCREMENT)", | 768 createSequence = fn s => "CREATE TABLE " ^ s ^ " (id INTEGER PRIMARY KEY AUTOINCREMENT)", |
767 textKeysNeedLengths = false, | 769 textKeysNeedLengths = false, |
768 supportsNextval = false, | 770 supportsNextval = false, |
769 supportsNestedPrepared = false, | 771 supportsNestedPrepared = false, |
770 sqlPrefix = ""} | 772 sqlPrefix = "", |
773 supportsOctetLength = false} | |
771 | 774 |
772 end | 775 end |