X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=usql%2Fbasic-cmds.lisp;fp=usql%2Fbasic-cmds.lisp;h=a8241b943b46fdbe0ca03ec4aa52e51b0694a5fc;hb=ce0e343835a040406678dff74a62d1b0cb56f317;hp=0000000000000000000000000000000000000000;hpb=edd1963395a5b5e5f91ef975fcd329975ae367e2;p=clsql.git diff --git a/usql/basic-cmds.lisp b/usql/basic-cmds.lisp new file mode 100644 index 0000000..a8241b9 --- /dev/null +++ b/usql/basic-cmds.lisp @@ -0,0 +1,32 @@ + +(defmethod database-query (query-expression (database closed-database) types) + (declare (ignore query-expression types)) + (signal-closed-database-error database)) + +(defmethod database-query (query-expression (database t) types) + (declare (ignore query-expression types)) + (signal-no-database-error)) + +(defmethod database-execute-command (sql-expression (database closed-database)) + (declare (ignore sql-expression)) + (signal-closed-database-error database)) + +(defmethod database-execute-command (sql-expression (database t)) + (declare (ignore sql-expression)) + (signal-no-database-error)) + +(defgeneric execute-command (expression &key database) + (:documentation + "Executes the SQL command specified by EXPRESSION for the database +specified by DATABASE, which has a default value of +*DEFAULT-DATABASE*. The argument EXPRESSION may be any SQL statement +other than a query. To run a stored procedure, pass an appropriate +string. The call to the procedure needs to be wrapped in a BEGIN END +pair.")) + +(defmethod execute-command ((sql-expression string) + &key (database *default-database*)) + (record-sql-command sql-expression database) + (let ((res (database-execute-command sql-expression database))) + (record-sql-result res database)) + (values))