From 354e7b70d58c15b9ea8f0d5b2fcab434d846a99f Mon Sep 17 00:00:00 2001 From: Dmitry Kalyanov Date: Sat, 13 Jun 2009 22:03:18 +0400 Subject: [PATCH] Allow passing pathnames into sqlite:connect --- index.html | 2 +- sqlite.lisp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index ade9a84..2d96468 100644 --- a/index.html +++ b/index.html @@ -193,7 +193,7 @@ Supported types:


[Function]
connect database-path => sqlite-handle


-Connect to the sqlite database at the given database-path. Returns the sqlite-handle connected to the database. Use disconnect to disconnect. +Connect to the sqlite database at the given database-path (database-path is a string or a pathname). If database-path equal to ":memory:" is given, a new in-memory database is created. Returns the sqlite-handle connected to the database. Use disconnect to disconnect.
diff --git a/sqlite.lisp b/sqlite.lisp index 4b8952a..d7da9bd 100644 --- a/sqlite.lisp +++ b/sqlite.lisp @@ -41,7 +41,10 @@ (defun connect (database-path) "Connect to the sqlite database at the given DATABASE-PATH. Returns the SQLITE-HANDLE connected to the database. Use DISCONNECT to disconnect." - (make-instance 'sqlite-handle :database-path database-path)) + (make-instance 'sqlite-handle + :database-path (etypecase database-path + (string database-path) + (pathname (namestring database-path))))) (defun disconnect (handle) "Disconnects the given HANDLE from the database. All further operations on the handle are invalid." -- 2.11.4.GIT