From e3d4594eb7a2f9db7fc31ec0cc5ae119be3fa55a Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 28 Dec 2012 22:03:55 +0100 Subject: Add/improve some documentation comments Since CHICKEN scheme doesn't do docstrings I'm just using comments. --- src/convert.scm | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/convert.scm') diff --git a/src/convert.scm b/src/convert.scm index 3229823..99f42b7 100644 --- a/src/convert.scm +++ b/src/convert.scm @@ -28,11 +28,18 @@ (require-library srfi-4) (define (blob->seconds blob) + ;; Convert BLOB to an integer representing the seconds since + ;; 01-01-1970 (standard unix timstamp). This has to be done because + ;; in the previous version of linkwave I stored the timestamp as a + ;; blob and CHICKEN doesn't seem to like blobs much. (if (u32vector? blob) (u32vector-ref (blob->u32vector blob) 0) 0)) (define (convert-table db name converter #!optional select) + ;; Convert NAME from DB using CONVERTER for each specific row. The + ;; optional SELECT should be an SQL query that will be used to fetch + ;; the rows to convert. (let ((count (first-result db (string-append "SELECT COUNT(*) FROM " name))) (progress 0)) (for-each-row (lambda args @@ -43,6 +50,8 @@ (newline))) (define (convert) + ;; Convert an old database into a new one and then replace the old + ;; with the new. (let ((old-db (open-database (data-file "linkwave.db"))) (new-db (open-database (data-file "nlinkwave.db")))) (execute new-db "CREATE TABLE bookmark (url VARCHAR(255) UNIQUE, date INTEGER, name VARCHAR(255), description TEXT)") -- cgit v1.3-2-g0d8e