472de2ddfe9bf8de36793d63fd3bd1ee79223468
[clsql.git] / sql / usql.lisp
1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
4 ;;;;
5 ;;;; Name:          usql.lisp
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$
12 ;;;;
13 ;;;; This file, part of CLSQL, is Copyright (c) 2002-2004 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 (in-package #:clsql-sys)
25
26 (defun list-tables (&key (database *default-database*))
27   "List all tables in *default-database*, or if the :database keyword arg
28 is given, the specified database.  If the keyword arg :system-tables
29 is true, then it will not filter out non-user tables.  Table names are
30 given back as a list of strings."
31   (database-list-tables database))
32
33
34 (defun list-attributes (table &key (database *default-database*))
35   "List the attributes of TABLE in *default-database, or if the
36 :database keyword is given, the specified database.  Attributes are
37 returned as a list of strings."
38   (database-list-attributes table database))
39
40 (defun attribute-type (attribute table &key (database *default-database*))
41   "Return the field type of the ATTRIBUTE in TABLE.  The optional
42 keyword argument :database specifies the database to query, defaulting
43 to *default-database*."
44   (database-attribute-type attribute table database))
45
46 (defun create-sequence (name &key (database *default-database*))
47   (database-create-sequence name database))
48
49 (defun drop-sequence (name &key (database *default-database*))
50   (database-drop-sequence name database))
51
52 (defun sequence-next (name &key (database *default-database*))
53   (database-sequence-next name database))
54
55