r8880: v2.3.3
[clsql.git] / sql / basic-cmds.lisp
1
2 (defmethod database-query (query-expression (database closed-database) types)
3   (declare (ignore query-expression types))
4   (signal-closed-database-error database))
5
6 (defmethod database-query (query-expression (database t) types)
7   (declare (ignore query-expression types))
8   (signal-no-database-error))
9
10 (defmethod database-execute-command (sql-expression (database closed-database))
11   (declare (ignore sql-expression))
12   (signal-closed-database-error database))
13
14 (defmethod database-execute-command (sql-expression (database t))
15   (declare (ignore sql-expression))
16   (signal-no-database-error))
17
18 (defgeneric execute-command (expression &key database)
19   (:documentation
20    "Executes the SQL command specified by EXPRESSION for the database
21 specified by DATABASE, which has a default value of
22 *DEFAULT-DATABASE*. The argument EXPRESSION may be any SQL statement
23 other than a query. To run a stored procedure, pass an appropriate
24 string. The call to the procedure needs to be wrapped in a BEGIN END
25 pair."))
26
27 (defmethod execute-command ((sql-expression string)
28                             &key (database *default-database*))
29   (record-sql-command sql-expression database)
30   (let ((res (database-execute-command sql-expression database)))
31     (record-sql-result res database))
32   (values))