# Programer: Kevin M. Rosenberg
# Date Started: Mar 2002
#
-# CVS Id: $Id: Makefile,v 1.24 2002/09/18 07:51:22 kevin Exp $
+# CVS Id: $Id$
#
# This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
#
;;;; original code by Pierre R. Mai
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: classes.lisp,v 1.1 2002/09/30 10:19:01 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: cmucl-compat.lisp,v 1.5 2003/05/06 02:29:46 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
;;;; Original code by Pierre R. Mai
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: conditions.lisp,v 1.2 2002/10/21 07:45:50 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
;;;; onShoreD to support UncommonSQL front-end
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: db-interface.lisp,v 1.1 2002/09/30 10:19:01 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and Copyright (c) 1999-2001 by Pierre R. Mai, and onShoreD
;;;; Programmers: Kevin M. Rosenberg
;;;; Date Started: May 2002
;;;;
-;;;; $Id: initialize.lisp,v 1.2 2002/10/16 11:51:04 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
;;;; Original code by Pierre R. Mai
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: package.lisp,v 1.2 2003/05/07 02:45:08 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Mar 2002
;;;;
-;;;; $Id: utils.lisp,v 1.2 2002/10/21 07:45:50 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Aug 2002
;;;;
-;;;; $Id: clsql-aodbc.asd,v 1.13 2003/05/07 02:45:08 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: clsql-base.asd,v 1.19 2003/05/07 02:45:08 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
-;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-\r
-;;;; *************************************************************************\r
-;;;; FILE IDENTIFICATION\r
-;;;;\r
-;;;; Name: clsql-mysql.asd\r
-;;;; Purpose: ASDF definition file for CLSQL MySQL backend\r
-;;;; Programmer: Kevin M. Rosenberg\r
-;;;; Date Started: Aug 2002\r
-;;;;\r
-;;;; $Id: clsql-mysql.asd,v 1.14 2003/05/07 02:45:08 kevin Exp $\r
-;;;;\r
-;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg\r
-;;;;\r
-;;;; CLSQL users are granted the rights to distribute and use this software\r
-;;;; as governed by the terms of the Lisp Lesser GNU Public License\r
-;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.\r
-;;;; *************************************************************************\r
-\r
-(defpackage #:clsql-mysql-system (:use #:asdf #:cl))\r
-(in-package #:clsql-mysql-system)\r
-\r
-;;; System definition\r
-\r
-#+(or allegro lispworks cmu sbcl openmcl mcl scl)\r
-(defsystem :clsql-mysql\r
- :name "cl-sql-mysql"\r
- :author "Kevin M. Rosenberg <kmr@debian.org>"\r
- :maintainer "Kevin M. Rosenberg <kmr@debian.org>"\r
- :licence "Lessor Lisp General Public License"\r
- :description "Common Lisp SQL MySQL Driver"\r
- :long-description "cl-sql-mysql package provides a database driver to the MySQL database system."\r
-\r
- :components\r
- ((:module :db-mysql\r
- :components\r
- ((:file "mysql-package")\r
- (:file "mysql-loader" :depends-on ("mysql-package"))\r
- (:file "mysql-api" :depends-on ("mysql-loader"))\r
- (:file "mysql-sql" :depends-on ("mysql-api"))\r
- (:file "mysql-usql" :depends-on ("mysql-sql")))))\r
- :depends-on (:uffi :clsql-base :clsql-uffi))\r
+;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
+;;;; *************************************************************************
+;;;; FILE IDENTIFICATION
+;;;;
+;;;; Name: clsql-mysql.asd
+;;;; Purpose: ASDF definition file for CLSQL MySQL backend
+;;;; Programmer: Kevin M. Rosenberg
+;;;; Date Started: Aug 2002
+;;;;
+;;;; $Id$
+;;;;
+;;;; 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.
+;;;; *************************************************************************
+
+(defpackage #:clsql-mysql-system (:use #:asdf #:cl))
+(in-package #:clsql-mysql-system)
+
+;;; System definition
+
+#+(or allegro lispworks cmu sbcl openmcl mcl scl)
+(defsystem :clsql-mysql
+ :name "cl-sql-mysql"
+ :author "Kevin M. Rosenberg <kmr@debian.org>"
+ :maintainer "Kevin M. Rosenberg <kmr@debian.org>"
+ :licence "Lessor Lisp General Public License"
+ :description "Common Lisp SQL MySQL Driver"
+ :long-description "cl-sql-mysql package provides a database driver to the MySQL database system."
+
+ :components
+ ((:module :db-mysql
+ :components
+ ((:file "mysql-package")
+ (:file "mysql-loader" :depends-on ("mysql-package"))
+ (:file "mysql-api" :depends-on ("mysql-loader"))
+ (:file "mysql-sql" :depends-on ("mysql-api"))
+ (:file "mysql-usql" :depends-on ("mysql-sql")))))
+ :depends-on (:uffi :clsql-base :clsql-uffi))
;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
;;;; This is copyrighted software. See interfaces/oracle/* files for terms.
;;;;
-;;;; $Id: clsql-oracle.asd,v 1.13 2003/05/07 02:45:08 kevin Exp $
+;;;; $Id$
(defpackage #:clsql-oracle-system (:use #:asdf #:cl))
(in-package #:clsql-oracle-system)
-;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-\r
-;;;; *************************************************************************\r
-;;;; FILE IDENTIFICATION\r
-;;;;\r
-;;;; Name: clsql-postgresql-socket.asd\r
-;;;; Purpose: ASDF file for CLSQL PostgresSQL socket backend\r
-;;;; Programmer: Kevin M. Rosenberg\r
-;;;; Date Started: Aug 2002\r
-;;;;\r
-;;;; $Id: clsql-postgresql-socket.asd,v 1.16 2003/05/07 02:45:08 kevin Exp $\r
-;;;;\r
-;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg\r
-;;;;\r
-;;;; CLSQL users are granted the rights to distribute and use this software\r
-;;;; as governed by the terms of the Lisp Lesser GNU Public License\r
-;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.\r
-;;;; *************************************************************************\r
-\r
-(defpackage #:clsql-postgresql-socket-system (:use #:asdf #:cl))\r
-(in-package #:clsql-postgresql-socket-system)\r
-\r
-;;; System definition\r
-\r
-#+(or allegro lispworks cmu sbcl openmcl mcl scl)\r
-(defsystem clsql-postgresql-socket\r
- :name "cl-sql-postgresql-socket"\r
- :author "Kevin M. Rosenberg <kmr@debian.org>"\r
- :maintainer "Kevin M. Rosenberg <kmr@debian.org>"\r
- :licence "Lessor Lisp General Public License"\r
- :description "Common Lisp SQL PostgreSQL Socket Driver"\r
- :long-description "cl-sql-postgresql-socket package provides a database driver to the PostgreSQL database via a socket interface."\r
-\r
- :components\r
- ((:module :db-postgresql-socket\r
- :components\r
- ((:file "postgresql-socket-package")\r
- (:file "postgresql-socket-api"\r
- :depends-on ("postgresql-socket-package"))\r
- (:file "postgresql-socket-sql"\r
- :depends-on ("postgresql-socket-api")))))\r
- :depends-on (:clsql-base :uffi :md5))\r
+;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
+;;;; *************************************************************************
+;;;; FILE IDENTIFICATION
+;;;;
+;;;; Name: clsql-postgresql-socket.asd
+;;;; Purpose: ASDF file for CLSQL PostgresSQL socket backend
+;;;; Programmer: Kevin M. Rosenberg
+;;;; Date Started: Aug 2002
+;;;;
+;;;; $Id$
+;;;;
+;;;; 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.
+;;;; *************************************************************************
+
+(defpackage #:clsql-postgresql-socket-system (:use #:asdf #:cl))
+(in-package #:clsql-postgresql-socket-system)
+
+;;; System definition
+
+#+(or allegro lispworks cmu sbcl openmcl mcl scl)
+(defsystem clsql-postgresql-socket
+ :name "cl-sql-postgresql-socket"
+ :author "Kevin M. Rosenberg <kmr@debian.org>"
+ :maintainer "Kevin M. Rosenberg <kmr@debian.org>"
+ :licence "Lessor Lisp General Public License"
+ :description "Common Lisp SQL PostgreSQL Socket Driver"
+ :long-description "cl-sql-postgresql-socket package provides a database driver to the PostgreSQL database via a socket interface."
+
+ :components
+ ((:module :db-postgresql-socket
+ :components
+ ((:file "postgresql-socket-package")
+ (:file "postgresql-socket-api"
+ :depends-on ("postgresql-socket-package"))
+ (:file "postgresql-socket-sql"
+ :depends-on ("postgresql-socket-api")))))
+ :depends-on (:clsql-base :uffi :md5))
-;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-\r
-;;;; *************************************************************************\r
-;;;; FILE IDENTIFICATION\r
-;;;;\r
-;;;; Name: clsql-postgresql.asd\r
-;;;; Purpose: ASDF file for CLSQL PostgresSQL backend\r
-;;;; Programmer: Kevin M. Rosenberg\r
-;;;; Date Started: Aug 2002\r
-;;;;\r
-;;;; $Id: clsql-postgresql.asd,v 1.14 2003/05/07 02:45:08 kevin Exp $\r
-;;;;\r
-;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg\r
-;;;;\r
-;;;; CLSQL users are granted the rights to distribute and use this software\r
-;;;; as governed by the terms of the Lisp Lesser GNU Public License\r
-;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.\r
-;;;; *************************************************************************\r
-\r
-(defpackage #:clsql-postgresql-system (:use #:asdf #:cl))\r
-(in-package #:clsql-postgresql-system)\r
-\r
-#+(or allegro lispworks cmu sbcl openmcl mcl scl)\r
-(defsystem clsql-postgresql\r
- :name "cl-sql-postgresql"\r
- :author "Kevin M. Rosenberg <kmr@debian.org>"\r
- :maintainer "Kevin M. Rosenberg <kmr@debian.org>"\r
- :licence "Lessor Lisp General Public License"\r
- :description "Common Lisp PostgreSQL API Driver"\r
- :long-description "cl-sql-postgresql package provides a the database driver for the PostgreSQL API."\r
-\r
- :components\r
- ((:module :db-postgresql\r
- :components\r
- ((:file "postgresql-package")\r
- (:file "postgresql-loader" :depends-on ("postgresql-package"))\r
- (:file "postgresql-api" :depends-on ("postgresql-loader"))\r
- (:file "postgresql-sql" :depends-on ("postgresql-api"))\r
- (:file "postgresql-usql" :depends-on ("postgresql-sql")))))\r
- :depends-on (:uffi :clsql-base :clsql-uffi))\r
+;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
+;;;; *************************************************************************
+;;;; FILE IDENTIFICATION
+;;;;
+;;;; Name: clsql-postgresql.asd
+;;;; Purpose: ASDF file for CLSQL PostgresSQL backend
+;;;; Programmer: Kevin M. Rosenberg
+;;;; Date Started: Aug 2002
+;;;;
+;;;; $Id$
+;;;;
+;;;; 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.
+;;;; *************************************************************************
+
+(defpackage #:clsql-postgresql-system (:use #:asdf #:cl))
+(in-package #:clsql-postgresql-system)
+
+#+(or allegro lispworks cmu sbcl openmcl mcl scl)
+(defsystem clsql-postgresql
+ :name "cl-sql-postgresql"
+ :author "Kevin M. Rosenberg <kmr@debian.org>"
+ :maintainer "Kevin M. Rosenberg <kmr@debian.org>"
+ :licence "Lessor Lisp General Public License"
+ :description "Common Lisp PostgreSQL API Driver"
+ :long-description "cl-sql-postgresql package provides a the database driver for the PostgreSQL API."
+
+ :components
+ ((:module :db-postgresql
+ :components
+ ((:file "postgresql-package")
+ (:file "postgresql-loader" :depends-on ("postgresql-package"))
+ (:file "postgresql-api" :depends-on ("postgresql-loader"))
+ (:file "postgresql-sql" :depends-on ("postgresql-api"))
+ (:file "postgresql-usql" :depends-on ("postgresql-sql")))))
+ :depends-on (:uffi :clsql-base :clsql-uffi))
;;;; Author: Kevin M. Rosenberg
;;;; Date Started: Apr 2003
;;;;
-;;;; $Id: clsql-tests.asd,v 1.4 2003/07/20 18:31:22 kevin Exp $
+;;;; $Id$
;;;; *************************************************************************
(in-package #:cl-user)
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Aug 2002
;;;;
-;;;; $Id: clsql-uffi.asd,v 1.15 2003/05/07 02:45:08 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: clsql.asd,v 1.18 2003/05/07 02:45:08 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: aodbc-package.lisp,v 1.4 2003/05/07 02:45:08 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: aodbc-sql.lisp,v 1.2 2003/05/02 03:05:54 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
# Programer: Kevin M. Rosenberg
# Date Started: Mar 2002
#
-# CVS Id: $Id: Makefile,v 1.2 2002/12/09 10:34:16 kevin Exp $
+# CVS Id: $Id$
#
# This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
#
* Programmer: Kevin M. Rosenberg
* Date Started: Mar 2002
*
- * $Id: clsql-mysql.c,v 1.2 2002/12/09 10:34:16 kevin Exp $
+ * $Id$
*
* This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
*
;;;; Original code by Pierre R. Mai
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: mysql-api.lisp,v 1.6 2003/07/21 01:45:45 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
;;;; Programmers: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: mysql-loader.lisp,v 1.10 2003/05/17 07:02:00 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
;;;; Programmers: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: mysql-package.lisp,v 1.3 2003/05/07 02:45:08 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
;;;; Original code by Pierre R. Mai
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: mysql-sql.lisp,v 1.8 2003/07/21 01:45:45 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
-;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-\r
-;;;; *************************************************************************\r
-;;;; FILE IDENTIFICATION\r
-;;;;\r
-;;;; Name: mysql-usql.cl\r
-;;;; Purpose: MySQL interface functions to support UncommonSQL\r
-;;;; Programmers: Kevin M. Rosenberg and onShore Development Inc\r
-;;;; Date Started: Mar 2002\r
-;;;;\r
-;;;; $Id: mysql-usql.lisp,v 1.2 2003/06/26 15:27:07 kevin Exp $\r
-;;;;\r
-;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg\r
-;;;; and by onShore Development Inc.\r
-;;;;\r
-;;;; CLSQL users are granted the rights to distribute and use this software\r
-;;;; as governed by the terms of the Lisp Lesser GNU Public License\r
-;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.\r
-;;;; *************************************************************************\r
-\r
-(in-package #:clsql-mysql)\r
-\r
-;; Table and attribute introspection\r
-\r
-(defmethod database-list-tables ((database mysql-database)\r
- &key (system-tables nil))\r
- (declare (ignore system-tables))\r
- (mapcar #'car (database-query "show tables" database :auto)))\r
- \r
-\r
-(defmethod database-list-attributes ((table string) (database mysql-database))\r
- (mapcar #'car\r
- (database-query\r
- (format nil "SHOW COLUMNS FROM ~A" table)\r
- database nil)))\r
-\r
-(defmethod database-attribute-type (attribute (table string)\r
- (database mysql-database))\r
- (let ((result\r
- (mapcar #'cadr\r
- (database-query\r
- (format nil\r
- "SHOW COLUMNS FROM ~A LIKE '~A'" table attribute)\r
- database nil))))\r
- (let* ((str (car result))\r
- (end-str (position #\( str))\r
- (substr (subseq str 0 end-str)))\r
- (if substr\r
- (intern (string-upcase substr) :keyword) nil))))\r
-\r
-;;; Sequence functions\r
-\r
-(defun %sequence-name-to-table (sequence-name)\r
- (concatenate 'string "_usql_seq_" (sql-escape sequence-name)))\r
-\r
-(defmethod database-create-sequence (sequence-name\r
- (database mysql-database))\r
- (let ((table-name (%sequence-name-to-table sequence-name)))\r
- (database-execute-command\r
- (concatenate 'string "CREATE TABLE " table-name\r
- " (id int NOT NULL PRIMARY KEY AUTO_INCREMENT)")\r
- database)\r
- (database-execute-command \r
- (concatenate 'string "INSERT INTO " table-name\r
- " VALUES (-1)")\r
- database)))\r
-\r
-(defmethod database-drop-sequence (sequence-name\r
- (database mysql-database))\r
- (database-execute-command\r
- (concatenate 'string "DROP TABLE " (%sequence-name-to-table sequence-name)) \r
- database))\r
-\r
-(defmethod database-sequence-next (sequence-name (database mysql-database))\r
- (database-execute-command \r
- (concatenate 'string "UPDATE " (%sequence-name-to-table sequence-name)\r
- " SET id=LAST_INSERT_ID(id+1)")\r
- database)\r
- (mysql:mysql-insert-id (clsql-mysql::database-mysql-ptr database)))\r
-\r
-;; Misc USQL functions\r
-\r
-#|\r
-#+ignore\r
-(defmethod database-output-sql ((expr clsql-sys::sql-typecast-exp) \r
- (database mysql-database))\r
- (with-slots (clsql-sys::modifier clsql-sys::components)\r
- expr\r
- (if clsql-sys::modifier\r
- (progn\r
- (clsql-sys::output-sql clsql-sys::components database)\r
- (write-char #\: sql-sys::*sql-stream*)\r
- (write-char #\: sql-sys::*sql-stream*)\r
- (write-string (symbol-name clsql-sys::modifier) \r
- clsql-sys::*sql-stream*)))))\r
-\r
-#+ignore\r
-(defmethod database-output-sql-as-type ((type (eql 'integer)) val\r
- (database mysql-database))\r
- ;; typecast it so it uses the indexes\r
- (when val\r
- (make-instance 'clsql-sys::sql-typecast-exp\r
- :modifier 'int8\r
- :components val)))\r
-|#\r
+;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
+;;;; *************************************************************************
+;;;; FILE IDENTIFICATION
+;;;;
+;;;; Name: mysql-usql.cl
+;;;; Purpose: MySQL interface functions to support UncommonSQL
+;;;; Programmers: Kevin M. Rosenberg and onShore Development Inc
+;;;; Date Started: Mar 2002
+;;;;
+;;;; $Id$
+;;;;
+;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
+;;;; and by onShore Development Inc.
+;;;;
+;;;; 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-mysql)
+
+;; Table and attribute introspection
+
+(defmethod database-list-tables ((database mysql-database)
+ &key (system-tables nil))
+ (declare (ignore system-tables))
+ (mapcar #'car (database-query "show tables" database :auto)))
+
+
+(defmethod database-list-attributes ((table string) (database mysql-database))
+ (mapcar #'car
+ (database-query
+ (format nil "SHOW COLUMNS FROM ~A" table)
+ database nil)))
+
+(defmethod database-attribute-type (attribute (table string)
+ (database mysql-database))
+ (let ((result
+ (mapcar #'cadr
+ (database-query
+ (format nil
+ "SHOW COLUMNS FROM ~A LIKE '~A'" table attribute)
+ database nil))))
+ (let* ((str (car result))
+ (end-str (position #\( str))
+ (substr (subseq str 0 end-str)))
+ (if substr
+ (intern (string-upcase substr) :keyword) nil))))
+
+;;; Sequence functions
+
+(defun %sequence-name-to-table (sequence-name)
+ (concatenate 'string "_usql_seq_" (sql-escape sequence-name)))
+
+(defmethod database-create-sequence (sequence-name
+ (database mysql-database))
+ (let ((table-name (%sequence-name-to-table sequence-name)))
+ (database-execute-command
+ (concatenate 'string "CREATE TABLE " table-name
+ " (id int NOT NULL PRIMARY KEY AUTO_INCREMENT)")
+ database)
+ (database-execute-command
+ (concatenate 'string "INSERT INTO " table-name
+ " VALUES (-1)")
+ database)))
+
+(defmethod database-drop-sequence (sequence-name
+ (database mysql-database))
+ (database-execute-command
+ (concatenate 'string "DROP TABLE " (%sequence-name-to-table sequence-name))
+ database))
+
+(defmethod database-sequence-next (sequence-name (database mysql-database))
+ (database-execute-command
+ (concatenate 'string "UPDATE " (%sequence-name-to-table sequence-name)
+ " SET id=LAST_INSERT_ID(id+1)")
+ database)
+ (mysql:mysql-insert-id (clsql-mysql::database-mysql-ptr database)))
+
+;; Misc USQL functions
+
+#|
+#+ignore
+(defmethod database-output-sql ((expr clsql-sys::sql-typecast-exp)
+ (database mysql-database))
+ (with-slots (clsql-sys::modifier clsql-sys::components)
+ expr
+ (if clsql-sys::modifier
+ (progn
+ (clsql-sys::output-sql clsql-sys::components database)
+ (write-char #\: sql-sys::*sql-stream*)
+ (write-char #\: sql-sys::*sql-stream*)
+ (write-string (symbol-name clsql-sys::modifier)
+ clsql-sys::*sql-stream*)))))
+
+#+ignore
+(defmethod database-output-sql-as-type ((type (eql 'integer)) val
+ (database mysql-database))
+ ;; typecast it so it uses the indexes
+ (when val
+ (make-instance 'clsql-sys::sql-typecast-exp
+ :modifier 'int8
+ :components val)))
+|#
;;; -*- Mode: Lisp -*-
-;;; $Id: alien-resources.lisp,v 1.1 2002/09/30 10:19:23 kevin Exp $
+;;; $Id$
;;; This is copyrighted software. See documentation for terms.
;;;
;;; -*- Mode: Lisp -*-
-;;; $Id: oracle-constants.lisp,v 1.1 2002/09/30 10:19:23 kevin Exp $
+;;; $Id$
(in-package :clsql-oracle)
;;; -*- Mode: Lisp -*-
-;;; $Id: oracle-loader.lisp,v 1.1 2002/09/30 10:19:23 kevin Exp $
+;;; $Id$
;;;
;;; MaiSQL --- Common Lisp Interface Layer to SQL Databases
;;; This is copyrighted software. See documentation for terms.
;;; -*- Mode: Lisp -*-
-;;; $Id: oracle-package.lisp,v 1.1 2002/09/30 10:19:23 kevin Exp $
+;;; $Id$
;;;
;;; This is copyrighted software. See documentation for terms.
;;; -*- Mode: Lisp -*-
-;;; $Id: oracle-sql.lisp,v 1.1 2002/09/30 10:19:23 kevin Exp $
+;;; $Id$
;;; MaiSQL --- Common Lisp Interface Layer to SQL Databases
;;; This is copyrighted software. See documentation for terms.
;;; -*- Mode: Lisp -*-
-;;; $Id: oracle.lisp,v 1.1 2002/09/30 10:19:23 kevin Exp $
+;;; $Id$
;;; MaiSQL --- Common Lisp Interface Layer to SQL Databases
;;; This is copyrighted software. See documentation for terms.
;;;;
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: postgresql-socket-api.lisp,v 1.4 2003/05/02 03:05:54 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
;;;; Programmers: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: postgresql-socket-package.lisp,v 1.4 2003/05/07 02:45:08 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
;;;; Original code by Pierre R. Mai
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: postgresql-socket-sql.lisp,v 1.4 2003/09/03 18:23:57 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
;;;; Original code by Pierre R. Mai
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: postgresql-api.lisp,v 1.1 2002/09/30 10:19:23 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: postgresql-loader.lisp,v 1.2 2002/11/23 18:00:26 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: postgresql-package.lisp,v 1.2 2003/05/07 02:45:08 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
;;;; Original code by Pierre R. Mai
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: postgresql-sql.lisp,v 1.3 2003/07/21 01:45:45 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
;;;; Programmers: Kevin M. Rosenberg and onShore Development Inc
;;;; Date Started: Mar 2002
;;;;
-;;;; $Id: postgresql-usql.lisp,v 1.2 2003/06/26 15:27:07 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and by onShore Development Inc.
# Programer: Kevin M. Rosenberg
# Date Started: Mar 2002
#
-# CVS Id: $Id: Makefile,v 1.17 2002/10/14 07:16:04 kevin Exp $
+# CVS Id: $Id$
#
# This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
#
;;;;
;;;; Copyright (c) 1999-2001 Pierre R. Mai
;;;;
-;;;; $Id: functional.lisp,v 1.1 2002/09/30 10:19:23 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file is part of CLSQL.
;;;;
;;;;
;;;; Copyright (c) 1999-2001 Pierre R. Mai
;;;;
-;;;; $Id: loop-extension.lisp,v 1.2 2002/10/21 07:45:50 kevin Exp $
+;;;; $Id$
;;;;
;;;; The functions in this file were orignally distributed in the
;;;; MaiSQL package in the file sql/sql.cl
;;;; Original code by Pierre R. Mai
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: package.lisp,v 1.5 2003/07/23 19:33:38 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
;;;; Programmers: Kevin M. Rosenberg, Marc Battyani
;;;; Date Started: Apr 2002
;;;;
-;;;; $Id: pool.lisp,v 1.5 2003/08/08 09:04:13 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002-2003 by Kevin M. Rosenberg
;;;;
;;;; Authors: Kevin M. Rosenberg based on code by Pierre R. Mai
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: sql.lisp,v 1.6 2003/07/23 19:33:38 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
;;;; Programmers: Marc Battyani
;;;; Date Started: Apr 2002
;;;;
-;;;; $Id: transactions.lisp,v 1.2 2002/10/14 15:25:15 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
;;;; Programmers: Kevin M. Rosenberg and onShore Development Inc
;;;; Date Started: Mar 2002
;;;;
-;;;; $Id: usql.lisp,v 1.1 2002/09/30 10:19:23 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;; and onShore Development Inc
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Mar 2002
;;;;
-;;;; $Id: xptest-clsql.lisp,v 1.1 2003/05/02 03:08:58 kevin Exp $
+;;;; $Id$
;;;;
;;;; The XPTest package can be downloaded from
;;;; http://alpha.onshored.com/lisp-software/
;;;; Author: Kevin M. Rosenberg
;;;; Date Started: Apr 2003
;;;;
-;;;; $Id: package.lisp,v 1.4 2003/07/20 18:31:22 kevin Exp $
+;;;; $Id$
;;;; *************************************************************************
(in-package #:cl-user)
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Mar 2002
;;;;
-;;;; $Id: tables.lisp,v 1.1 2003/05/02 03:08:58 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Mar 2002
;;;;
-;;;; $Id: tests.lisp,v 1.3 2003/05/02 03:29:28 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
# Programer: Kevin M. Rosenberg
# Date Started: Mar 2002
#
-# CVS Id: $Id: Makefile,v 1.3 2002/12/09 10:34:16 kevin Exp $
+# CVS Id: $Id$
#
# This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
#
;;;; Programmers: Kevin M. Rosenberg
;;;; Date Started: Mar 2002
;;;;
-;;;; $Id: clsql-uffi-loader.lisp,v 1.5 2003/07/08 20:15:13 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
;;;; Programmers: Kevin M. Rosenberg
;;;; Date Started: Mar 2002
;;;;
-;;;; $Id: clsql-uffi-package.lisp,v 1.3 2003/05/07 02:45:08 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
* Programmer: Kevin M. Rosenberg
* Date Started: Mar 2002
*
- * $Id: clsql-uffi.c,v 1.1 2002/09/18 07:50:01 kevin Exp $
+ * $Id$
*
* This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
*
;;;; Programmers: Kevin M. Rosenberg
;;;; Date Started: Mar 2002
;;;;
-;;;; $Id: clsql-uffi.lisp,v 1.32 2003/06/23 19:25:30 kevin Exp $
+;;;; $Id$
;;;;
;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;