X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=db-sqlite3%2Fsqlite3-sql.lisp;h=927716a0c356f01a56861684bec099ce8ad05a04;hb=fe6d36c16c61c855fc3b0c0c7c07f3cf3de4241d;hp=1ba6b0ba68649deee35d6a367d1b9bc826095f08;hpb=90ce2284fab5f1daedb8aa6aba3008a5c3651e30;p=clsql.git diff --git a/db-sqlite3/sqlite3-sql.lisp b/db-sqlite3/sqlite3-sql.lisp index 1ba6b0b..927716a 100644 --- a/db-sqlite3/sqlite3-sql.lisp +++ b/db-sqlite3/sqlite3-sql.lisp @@ -4,12 +4,10 @@ ;;;; ;;;; Name: sqlite-sql.lisp ;;;; Purpose: High-level SQLite3 interface -;;;; Authors: Aurelio Bignoli +;;;; Authors: Aurelio Bignoli & Kevin Rosenberg ;;;; Created: Oct 2004 ;;;; -;;;; $Id$ -;;;; -;;;; This file, part of CLSQL, is Copyright (c) 2004 by Aurelio Bignoli +;;;; This file, part of CLSQL, is Copyright (c) 2004-2010 by Aurelio Bignoli & Kevin Rosenberg ;;;; ;;;; CLSQL users are granted the rights to distribute and use this software ;;;; as governed by the terms of the Lisp Lesser GNU Public License @@ -170,11 +168,13 @@ (if (eq (first types) :blob) (clsql-uffi:convert-raw-field (sqlite3:sqlite3-column-blob stmt i) - types 0 - (sqlite3:sqlite3-column-bytes stmt i)) + (car types) + :length (sqlite3:sqlite3-column-bytes stmt i) + :encoding (encoding database)) (clsql-uffi:convert-raw-field (sqlite3:sqlite3-column-text stmt i) - types 0)))) + (car types) + :encoding (encoding database))))) ;; Advance result set cursor. (handler-case (unless (sqlite3:sqlite3-step stmt) @@ -203,11 +203,13 @@ collect (if (eq (first types) :blob) (clsql-uffi:convert-raw-field (sqlite3:sqlite3-column-blob stmt i) - types 0 - (sqlite3:sqlite3-column-bytes stmt i)) + (car types) + :length (sqlite3:sqlite3-column-bytes stmt i) + :encoding (encoding database)) (clsql-uffi:convert-raw-field (sqlite3:sqlite3-column-text stmt i) - types 0))))) + (car types) + :encoding (encoding database)))))) (when field-names (setf col-names (loop for n from 0 below n-col collect (sqlite3:sqlite3-column-name stmt n)))) @@ -281,13 +283,13 @@ (database sqlite3-database) &key (owner nil)) (declare (ignore owner)) - + (loop for field-info in (sqlite3-table-info table database) when (string= attribute (second field-info)) return (let* ((raw-type (third field-info)) (start-length (position #\( raw-type)) - (type (string-trim '(#\space #\tab #\newline) + (type (string-trim clsql-sys::+whitespace-chars+ (if start-length (subseq raw-type 0 start-length) raw-type)))