Closed rudolph-miller closed 9 years ago
It can be done like datafly does. (datafly is my newer project and it may have better interfaces) I'll think about it later.
Hm, I just got why did you get to #9.
However, I'm not willing to add such a specific feature for DB sharding.
Why don't you define an :around
method for select-dao
like this?
(defmethod select-dao :around ((class <dao-table-class>) &rest expressions)
(let ((*db* *read-db-connection*))
(call-next-method)))
I see, it's method. That's useful solution.
Okay, I'm gonna make some changes for it, like exporting make-connection
and *db*
. :+1:
and please make make-connection
more easily.
API should be like (connect-toplivel :mysql :database-name "sample" user: "sample-user")
Sure. I saw what you've done at #9 and it looks nicer. :grin:
thx :smile:
LGTM without the doc of (defvar *db* nil "Current connection object.Don't use from other packages.")
and I could handle read-replica with (defmethod retrieve-by-sql :around)
.
thx :)
connect-top-level and get-connection can handle only one connection. I want to meke these more customizable. any idea?
One way is to make
get-connection
customizable to take:select
or other keyword, and give:select
infind-dao
.