r2913: *** empty log message ***
[clsql.git] / sql / usql.cl
1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
4 ;;;;
5 ;;;; Name:          usql.cl
6 ;;;; Purpose:       High-level interface to SQL driver routines needed for
7 ;;;;                UncommonSQL
8 ;;;; Programmers:   Kevin M. Rosenberg and onShore Development Inc
9 ;;;; Date Started:  Mar 2002
10 ;;;;
11 ;;;; $Id: usql.cl,v 1.11 2002/09/17 17:16:43 kevin Exp $
12 ;;;;
13 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
14 ;;;; and onShore Development Inc
15 ;;;;
16 ;;;; CLSQL users are granted the rights to distribute and use this software
17 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
18 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
19 ;;;; *************************************************************************
20
21
22 ;;; Minimal high-level routines to enable low-level interface for USQL
23
24 (declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
25 (in-package :clsql-sys)
26
27 (defun list-tables (&key (database *default-database*)
28                          (system-tables nil))
29   "List all tables in *default-database*, or if the :database keyword arg
30 is given, the specified database.  If the keyword arg :system-tables
31 is true, then it will not filter out non-user tables.  Table names are
32 given back as a list of strings."
33   (database-list-tables database :system-tables system-tables))
34
35
36 (defun list-attributes (table &key (database *default-database*))
37   "List the attributes of TABLE in *default-database, or if the
38 :database keyword is given, the specified database.  Attributes are
39 returned as a list of strings."
40   (database-list-attributes table database))
41
42 (defun attribute-type (attribute table &key (database *default-database*))
43   "Return the field type of the ATTRIBUTE in TABLE.  The optional
44 keyword argument :database specifies the database to query, defaulting
45 to *default-database*."
46   (database-attribute-type attribute table database))
47
48 (defun create-sequence (name &key (database *default-database*))
49   (database-create-sequence name database))
50
51 (defun drop-sequence (name &key (database *default-database*))
52   (database-drop-sequence name database))
53
54 (defun sequence-next (name &key (database *default-database*))
55   (database-sequence-next name database))
56
57