Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

implemented `connect'.

  • Loading branch information...
commit f9051da22b670e20257681acc87d186db78abcf7 1 parent d4e02f9
@fukamachi authored
Showing with 16 additions and 2 deletions.
  1. +16 −2 src/dbi.lisp
View
18 src/dbi.lisp
@@ -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
)
Please sign in to comment.
Something went wrong with that request. Please try again.