Closed rudolph-miller closed 9 years ago
How about this?
(defvar *read-db* (make-connection :mysql :database-name "sample" :username "root" :host "read-replica-host")) (defvar *master-db* (make-connection :mysql :database-name "sample" :username "root" :host "master-host")) (setf *get-connection-fn* (lambda (&key query) (if (and query (>= (length query) 6) (string-equal query "SELECT" :end1 6)) (connection-established-handle *read-db*) (Connection-established-handle *master-db*))))
It's just the idea.
How about this?