Re: [CLSQL-Devel] Placeholders and/or Quoting in CLSQL

Kevin Rosenberg <kevin-HJRc7zDS/[email protected]> Thu, 28 Dec 2006 08:45:34 -0700
Newsgroups gmane.lisp.clsql.general,gmane.lisp.clsql.devel
Message-ID <[email protected]>
Edi Weitz wrote:
> There's PREPARE-SQL and friends for databases like PostgreSQL which
> support prepared statements.  (See doc/ref-prepared.xml which for
> reasons unknown to me isn't part of the released documentation.)  This
> is different from Perl's prepare, though, which is (IIRC) about
> preparation on the Perl side and not necessarily on the database side.

Hi Edi,

Because I'm not prepared to document and support prepared statements
until it is supported by at least MySQL. I think the top-level API may
change as I implement prepared statements across database
engines. Further, the postgresql support for prepared statements has
not performance increase over native SQL. So, I don't see a big rush
to document and support the nascent feature.
> --- clsql-3.7.8/sql/expressions.lisp.orig       2006-12-27 23:51:31.000000000 +0100
> +++ clsql-3.7.8/sql/expressions.lisp    2006-12-27 23:54:33.000000000 +0100
> @@ -22,7 +22,7 @@
>  (defvar *sql-stream* nil
>    "stream which accumulates SQL output")
>  
> -(defun sql-output (sql-expr &optional database)
> +(defun sql-output (sql-expr &optional (database *default-database*))
>    "Top-level call for generating SQL strings. Returns an SQL
>    string appropriate for DATABASE which corresponds to the
>    supplied lisp expression SQL-EXPR."

That's a reasonable patch for people who want to directly call
SQL-OUTPUT (which has never been me).

-- 
Kevin Rosenberg
[email protected]