From: Ryan Davis Date: Tue, 28 Aug 2012 18:13:40 +0000 (-0400) Subject: allow pathnames as well as strings in sqlite3 connection specs X-Git-Tag: v6.3.0~7 X-Git-Url: http://git.kpe.io/?p=clsql.git;a=commitdiff_plain;h=a407cdf939e54eb440f9ec5a975ad81858e86610 allow pathnames as well as strings in sqlite3 connection specs --- diff --git a/ChangeLog b/ChangeLog index 6a081a8..bf623de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-08-28 Ryan Davis + * db-sqlite3/sqlite3-api.lisp - allow pathnames in the connection + settings, so '("/db/my.sqlite") and '(#P"/db/my.sqlite") are + equivalent. Updated the docs to match. + 2012-08-17 Russ Tyndall * db-postgresql-socket3/package.lisp - shadow postgresql-notification for compatibility with new diff --git a/db-sqlite3/sqlite3-api.lisp b/db-sqlite3/sqlite3-api.lisp index d5b5153..942246e 100644 --- a/db-sqlite3/sqlite3-api.lisp +++ b/db-sqlite3/sqlite3-api.lisp @@ -289,7 +289,10 @@ ;;;; ;;;; wrapper functions. ;;;; -(defun sqlite3-open (db-name &optional (mode 0)) +(defun sqlite3-open (db &optional (mode 0) + &aux (db-name (etypecase db + (pathname (namestring db)) + (string db)))) (declare (ignore mode) (type string db-name)) (let ((dbp (allocate-foreign-object 'sqlite3-db))) (declare (type sqlite3-db-ptr-type dbp)) diff --git a/doc/appendix.xml b/doc/appendix.xml index da94765..f06f035 100644 --- a/doc/appendix.xml +++ b/doc/appendix.xml @@ -600,8 +600,8 @@ This file can contain forms to set site-specific paths as well as change filename - String representing the filename of the &sqlite; - database file. + String or pathname representing the filename of + the &sqlite; database file.