X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=sql%2Fclasses.lisp;h=5a22584f5f3e304ae8cd7758af2a93984e2ad2f7;hb=c4874967a9af719a5cf176677007120fe2cbb036;hp=c390c5f03e18feb77bdc3ba11459b8c149f0f59f;hpb=7f0e4a65d1b425f2fa58fc7cce8296c1a6c52c2f;p=clsql.git diff --git a/sql/classes.lisp b/sql/classes.lisp index c390c5f..5a22584 100644 --- a/sql/classes.lisp +++ b/sql/classes.lisp @@ -1,19 +1,19 @@ ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- -;;;; ====================================================================== -;;;; File: classes.lisp -;;;; Updated: <04/04/2004 12:08:49 marcusp> -;;;; ====================================================================== +;;;; ************************************************************************* ;;;; -;;;; Description ========================================================== -;;;; ====================================================================== +;;;; $Id$ ;;;; ;;;; Classes defining SQL expressions and methods for formatting the ;;;; appropriate SQL commands. ;;;; -;;;; ====================================================================== - -(in-package #:clsql-usql-sys) +;;;; This file is part of CLSQL. +;;;; +;;;; 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. +;;;; ************************************************************************* +(in-package #:clsql-sys) (defvar +empty-string+ "''") @@ -22,14 +22,6 @@ (defvar *sql-stream* nil "stream which accumulates SQL output") -(defvar *default-schema* "UNCOMMONSQL") - -(defvar *object-schemas* (make-hash-table :test #'equal) - "Hash of schema name to class constituent lists.") - -(defun in-schema (schemaname) - (setf *default-schema* schemaname)) - (defun sql-output (sql-expr &optional database) (progv '(*sql-stream*) `(,(make-string-output-stream)) @@ -202,6 +194,16 @@ (format *sql-stream* "~s" alias)))) t) +#| +(defmethod database-output-sql ((self duration) database) + (declare (ignore database)) + (format nil "'~a'" (duration-timestring self))) + +(defmethod database-output-sql ((self money) database) + (database-output-sql (slot-value self 'odcl::units) database)) +|# + + (defmethod output-sql-hash-key ((expr sql-ident-table) &optional (database *default-database*)) (declare (ignore database))