Permalink
Browse files

implemented `connect'.

  • Loading branch information...
1 parent d4e02f9 commit f9051da22b670e20257681acc87d186db78abcf7 @fukamachi committed Nov 1, 2011
Showing with 16 additions and 2 deletions.
  1. +16 −2 src/dbi.lisp
View
@@ -7,15 +7,29 @@
(defpackage dbi
(:use :cl)
(:import-from :dbi.driver
+ :list-all-drivers
+ :find-driver
+ :make-connection
:prepare
:execute)
- (:export :prepare
+ (:export :list-all-drivers
+ :find-driver
+ :prepare
:execute))
(in-package :dbi)
(cl-syntax:use-syntax :annot)
@export
-(defun connect (dsn)
+(defun connect (driver-name &rest params &allow-other-keys)
+ (let ((driver (find-driver driver-name)))
+ (unless driver
+ (error 'simple-error
+ :format-control "Driver ~A is not found."
+ :format-arguments driver-name))
+ (apply #'make-connection driver params)))
+
+@export
+(defun disconnect (conn)
;; TODO
)

0 comments on commit f9051da

Please sign in to comment.