X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Fdb-interface.lisp;h=5cdb719f3ea00cdc4915701fff2abec177aaff49;hp=8bcc42e964902f388ff840733b49239bb1d36ced;hb=d858cb15ce270fc5d1ad58abd651ba1864979e9f;hpb=d2d49ab13c98bc7a1819a0fd3968268a5567bdc3 diff --git a/sql/db-interface.lisp b/sql/db-interface.lisp index 8bcc42e..5cdb719 100644 --- a/sql/db-interface.lisp +++ b/sql/db-interface.lisp @@ -167,6 +167,12 @@ if unable to destory.")) (defgeneric database-sequence-last (name database) (:documentation "Select the last value in sequence NAME in DATABASE.")) +(defgeneric database-last-autoincrement-id (database table column) + (:documentation "Many databases have the notion of an auto-increment + id; i.e. a sequence implicitly on a table. This function should + return that ID." )) + + (defgeneric database-start-transaction (database) (:documentation "Start a transaction in DATABASE.") (:method ((database t)) @@ -425,6 +431,20 @@ of TYPE_NAME (keyword) PRECISION SCALE NULLABLE.") nil) (:documentation "Free the resources of a prepared statement.")) +(defgeneric database-acquire-from-conn-pool (database) + (:documentation "Acquire a database connection from the pool. This +is a chance to test the connection for validity before returning it to +the user. If this function returns NIL or throws an error that +database connection is considered bad and we make a new one. + +Database objects have a chance to specialize, otherwise the default +method uses the database-underlying-type and tries to do something +appropriate.")) + +(defgeneric database-release-to-conn-pool (database) + (:documentation "Chance for the database to cleanup before it is + returned to the connection pool.")) + ;; Checks for closed database (defmethod database-disconnect :before ((database database))