From 79dacf4fb7e6707e815c3e8072e5c809acaa9386 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Mon, 12 Apr 2004 17:56:57 +0000 Subject: [PATCH] r8973: add makefiles, remove explain function, fix truncate --- ChangeLog | 14 ++++++++++++++ Makefile | 4 ++-- base/basic-sql.lisp | 4 ---- base/database.lisp | 4 ++-- db-sqlite/Makefile | 22 ++++++++++++++++++++++ sql/sql.lisp | 11 +++-------- tests/Makefile | 22 ++++++++++++++++++++++ 7 files changed, 65 insertions(+), 16 deletions(-) create mode 100644 db-sqlite/Makefile create mode 100644 tests/Makefile diff --git a/ChangeLog b/ChangeLog index c095a50..ac3e517 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +12 Apr 2004 Kevin Rosenberg (kevin@rosenberg.net) + * Version 2.6.5 + * sql/sql.lisp: Fix TRUNCATE command, bug reported + by Marcus Pearce + * sql/sql.lisp: Remove EXPLAIN function. Postgresql/Oracle + specific and easy for an application to directly support. + Idea from Marcus Pearce. + * base/basic-sql.lisp: Remove DESCRIBE-TABLE top-level + API as duplicates LIST-ATTRIBUTE-TYPES [Marcus Pearce]. + Keep low-level interface for future optimization + supporting LIST-ATTRIBUTE-TYPES command. + * Makefile: Add to db-sqlite and test directories. + Include them in top-level Makefile + 12 Apr 2004 Kevin Rosenberg (kevin@rosenberg.net) * Version 2.6.5 * sql/relations.lisp: Add missing file diff --git a/Makefile b/Makefile index 564b092..1860a3a 100644 --- a/Makefile +++ b/Makefile @@ -15,8 +15,8 @@ PKG := clsql DEBPKG := cl-sql -SUBDIRS := sql uffi base db-mysql db-aodbc \ - db-postgresql db-postgresql-socket +SUBDIRS := sql tests uffi base db-mysql db-aodbc \ + db-postgresql db-postgresql-socket db-sqlite DOCSUBDIRS:=doc include Makefile.common diff --git a/base/basic-sql.lisp b/base/basic-sql.lisp index 5c12002..3873314 100644 --- a/base/basic-sql.lisp +++ b/base/basic-sql.lisp @@ -59,10 +59,6 @@ pair.")) (record-sql-action res :result database)) (values)) - -(defmethod describe-table ((table string) &key (database *default-database*)) - (database-describe-table database table)) - (defmacro do-query (((&rest args) query-expression &key (database '*default-database*) (result-types nil)) &body body) diff --git a/base/database.lisp b/base/database.lisp index 5f00b38..1c6fa63 100644 --- a/base/database.lisp +++ b/base/database.lisp @@ -176,10 +176,10 @@ error should be signaled if the existing database connection cannot be closed. When non-nil (this is the default value) the connection is closed without error checking. When FORCE is nil, an error is signaled if the database connection has been lost." - ;; TODO: just a placeholder + ;; TODO: Support all backends. Perhaps integrate with pools + ;; Handle error and force keywords (declare (ignore database error force))) - (defun status (&optional full) "The function STATUS prints status information to the standard diff --git a/db-sqlite/Makefile b/db-sqlite/Makefile new file mode 100644 index 0000000..2b79dcb --- /dev/null +++ b/db-sqlite/Makefile @@ -0,0 +1,22 @@ +# FILE IDENTIFICATION +# +# Name: Makefile +# Purpose: Makefile for CLSQL SQL interface +# Programer: Kevin M. Rosenberg +# Date Started: Mar 2002 +# +# CVS Id: $Id: Makefile 8153 2003-11-11 15:28:36Z kevin $ +# +# This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg +# +# CLSQL users are granted the rights to distribute and use this software +# as governed by the terms of the Lisp Lesser GNU Public License +# (http://opensource.franz.com/preamble.html), also known as the LLGPL. + +SUBDIRS= + +include ../Makefile.common + +.PHONY: distclean +distclean: clean + diff --git a/sql/sql.lisp b/sql/sql.lisp index a904c89..28d5a92 100644 --- a/sql/sql.lisp +++ b/sql/sql.lisp @@ -27,11 +27,6 @@ (execute-command (sql-output expr database) :database database) (values)) -(defmethod explain ((expr %sql-expression) &key (database *default-database*)) - (let ((expression (sql-output expr database))) - (format *standard-output* "explain: ~S~%" expression) - (execute-command (concatenate 'string "explain " expression)))) - (defmethod query ((expr %sql-expression) &key (database *default-database*) (result-types nil) (flatp nil)) @@ -44,11 +39,11 @@ (unless (is-database-open database) (database-reconnect database)) (dolist (table (list-tables database)) - (drop-table table database)) + (drop-table table :database database)) (dolist (index (list-indexes database)) - (drop-index index database)) + (drop-index index :database database)) (dolist (seq (list-sequences database)) - (drop-sequence seq database))) + (drop-sequence seq :database database))) (defun print-query (query-exp &key titles (formats t) (sizes t) (stream t) (database *default-database*)) diff --git a/tests/Makefile b/tests/Makefile new file mode 100644 index 0000000..2b79dcb --- /dev/null +++ b/tests/Makefile @@ -0,0 +1,22 @@ +# FILE IDENTIFICATION +# +# Name: Makefile +# Purpose: Makefile for CLSQL SQL interface +# Programer: Kevin M. Rosenberg +# Date Started: Mar 2002 +# +# CVS Id: $Id: Makefile 8153 2003-11-11 15:28:36Z kevin $ +# +# This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg +# +# CLSQL users are granted the rights to distribute and use this software +# as governed by the terms of the Lisp Lesser GNU Public License +# (http://opensource.franz.com/preamble.html), also known as the LLGPL. + +SUBDIRS= + +include ../Makefile.common + +.PHONY: distclean +distclean: clean + -- 2.34.1