X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=db-sqlite3%2Fsqlite3-sql.lisp;h=1ba6b0ba68649deee35d6a367d1b9bc826095f08;hp=90f08120d2895898719235cc85b2e262fc824395;hb=b20e411ae9adfae42e8b8cf6277a4f9f0c672816;hpb=a0fcaf1774e6f423fd23c8daaab9afb8ecb4e03a diff --git a/db-sqlite3/sqlite3-sql.lisp b/db-sqlite3/sqlite3-sql.lisp index 90f0812..1ba6b0b 100644 --- a/db-sqlite3/sqlite3-sql.lisp +++ b/db-sqlite3/sqlite3-sql.lisp @@ -281,14 +281,16 @@ (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 (if start-length - (subseq raw-type 0 start-length) - raw-type)) + (type (string-trim '(#\space #\tab #\newline) + (if start-length + (subseq raw-type 0 start-length) + raw-type))) (length (if start-length (parse-integer (subseq raw-type (1+ start-length)) :junk-allowed t)