[MLton-commit] r5247

Wesley Terpstra wesley at mlton.org
Sat Feb 17 17:17:23 PST 2007


add a short readme
----------------------------------------------------------------------

A   mltonlib/trunk/ca/terpstra/sqlite3/README
U   mltonlib/trunk/ca/terpstra/sqlite3/demo.sml
U   mltonlib/trunk/ca/terpstra/sqlite3/sql.sig

----------------------------------------------------------------------

Added: mltonlib/trunk/ca/terpstra/sqlite3/README
===================================================================
--- mltonlib/trunk/ca/terpstra/sqlite3/README	2007-02-18 01:08:43 UTC (rev 5246)
+++ mltonlib/trunk/ca/terpstra/sqlite3/README	2007-02-18 01:17:22 UTC (rev 5247)
@@ -0,0 +1,22 @@
+This directory contains source to code to bind the SQLite3 library to SML.
+
+   http://www.sqlite.org/  -- The SQLite project
+   http://www.mlton.org/   -- The Standard ML (SML) compiler targeted
+
+To compile the project, first compile SQLite and install the sqlite3 library
+into the default search path for your system. Also install mlton. Create
+a .mlb file for your project that lists sqlite.mlb, example: demo.mlb.
+
+To compile:
+
+   mlton -link-opt "-lsqlite3" your-project.mlb
+
+The complete interface to the library is covered in sql.sig. See demo.sml
+for example code that creates SQL functions and queries.
+
+Copyright:
+
+The original author of SQLite-SML binding has dedicated the code to the
+public domain. Anyone is free to copy, modify, publish, use, compile, sell,
+or distribute the original code, either in source code form or as a compiled
+binary, for any purpose, commercial or non-commercial, and by any means.

Modified: mltonlib/trunk/ca/terpstra/sqlite3/demo.sml
===================================================================
--- mltonlib/trunk/ca/terpstra/sqlite3/demo.sml	2007-02-18 01:08:43 UTC (rev 5246)
+++ mltonlib/trunk/ca/terpstra/sqlite3/demo.sml	2007-02-18 01:17:22 UTC (rev 5247)
@@ -31,7 +31,7 @@
   val sum2 = { init = fn () => 0, 
                step = fn (i, (j & k)) => i + Int64.fromInt j + k, 
                finish = fn x => Int64.toString x }
-  val () = SQL.registerFunction  (db, "wes", fnS iS iS $ concat)
+  val () = SQL.registerFunction  (db, "concat", fnS iS iS $ concat)
   val () = SQL.registerFunction  (db, "debug", fnN iAS $ debug)
   val () = SQL.registerFunction  (db, "glom", fnS iS iI $ glom)
   val () = SQL.registerCollation (db, "sless", String.compare)

Modified: mltonlib/trunk/ca/terpstra/sqlite3/sql.sig
===================================================================
--- mltonlib/trunk/ca/terpstra/sqlite3/sql.sig	2007-02-18 01:08:43 UTC (rev 5246)
+++ mltonlib/trunk/ca/terpstra/sqlite3/sql.sig	2007-02-18 01:17:22 UTC (rev 5247)
@@ -48,7 +48,7 @@
        *   val Q2 = prepare db "insert into table2 values (4, 6);" $
        * end
        * ...
-       * val () = SQL.app (fn (x & y) => ...) Q1 (1 & "arg2")
+       * val () = SQL.app (fn (x & y) => x ^ Real.toString y) Q1 (1 & "arg2")
        * val () = SQL.exec Q2 ()
        *)
       structure Query :




More information about the MLton-commit mailing list