Commits

carl douglas  committed bec3389

Import library

  • Participants
  • Parent commits 9a44841

Comments (0)

Files changed (4)

 ;   make
 ;   ./scm-mysql-example
 
-(require-library mysql-client)
+(use mysql-client)
 
 (define sql (make-mysql-connection "localhost" "root" #f "information_schema"))
 

File mysql-client.scm

 ; A (NULL) value is represented by a string containing 
 ; a 0x04 0x00 char sequence.
 
+(module mysql-client (make-mysql-connection)
+        (import scheme chicken foreign)
+
 (define (make-mysql-connection host user pass database)
   (define mysql-c (make-mysql-c-connection host user pass database))
   (set-finalizer! mysql-c 
                   (lambda(x) 
-                    (close-mysql-c-connection mysql-c-conn)))
+                    (close-mysql-c-connection mysql-c)))
   (define (mysql-query sql)
     (define result-c (mysql-c-query mysql-c sql))
     (define (fetch-c)(let ((row (mysql-c-fetch-row result-c)))
 END
 ))
 
-
+)

File mysql-client.setup

 
 (compile -C ,iflags
          -L ,lflags
-         -s mysql-client.scm)
+         -k 
+         -s mysql-client.scm 
+         -j mysql-client)
+(compile -s mysql-client.import.scm)
 
 (install-extension 
   'mysql-client
-  '("mysql-client.so")
+  '("mysql-client.so" "mysql-client.import.so")
   '((version "0.3")))
 

File tests/run.scm

-(require-library mysql-client)
+(use mysql-client)
 
 (define mysql 
   (make-mysql-connection "localhost" "root" "" "information_schema"))