Common Lisp Package: CLSQL-USER

This is the user package with CLSQL symbols.

README:

FUNCTION

Public

ADD-SQL-STREAM (STREAM &KEY (TYPE COMMANDS) (DATABASE *DEFAULT-DATABASE*))

Adds the supplied stream STREAM (or T for *standard-output*) as a component of the recording broadcast stream for the SQL recording type specified by TYPE on DATABASE which defaults to *DEFAULT-DATABASE*. TYPE must be one of :commands, :results, or :both, defaulting to :commands, depending on whether the stream is to be added for recording SQL commands, results or both.

ADD-TRANSACTION-COMMIT-HOOK (COMMIT-HOOK &KEY (DATABASE *DEFAULT-DATABASE*))

Adds COMMIT-HOOK, which should a designator for a function with no required arguments, to the list of hooks run when COMMIT is called on DATABASE which defaults to *DEFAULT-DATABASE*.

ADD-TRANSACTION-ROLLBACK-HOOK (ROLLBACK-HOOK &KEY (DATABASE *DEFAULT-DATABASE*))

Adds ROLLBACK-HOOK, which should a designator for a function with no required arguments, to the list of hooks run when ROLLBACK is called on DATABASE which defaults to *DEFAULT-DATABASE*.

ATTRIBUTE-TYPE (ATTRIBUTE TABLE &KEY (OWNER NIL) (DATABASE *DEFAULT-DATABASE*))

Returns a keyword representing the vendor-specific field type of the supplied attribute ATTRIBUTE in the table specified by TABLE in DATABASE which defaults to *DEFAULT-DATABASE*. OWNER is nil by default which means that the attribute specified by ATTRIBUTE, if it exists, must be user owned else nil is returned. If OWNER is a string denoting a user name, the attribute, if it exists, must be owned by OWNER else nil is returned, whereas if OWNER is :all then the attribute, if it exists, will be returned regardless of its owner.

BIND-PARAMETER (PREPARED-STMT POSITION VALUE)

Sets the value of a parameter is in prepared statement.

CACHE-TABLE-QUERIES (TABLE &KEY (ACTION NIL) (DATABASE *DEFAULT-DATABASE*))

Controls the caching of attribute type information on the table specified by TABLE in DATABASE which defaults to *DEFAULT-DATABASE*. ACTION specifies the caching behaviour to adopt. If its value is t then attribute type information is cached whereas if its value is nil then attribute type information is not cached. If ACTION is :flush then all existing type information in the cache for TABLE is removed, but caching is still enabled. TABLE may be a string representing a table for which the caching action is to be taken while the caching action is applied to all tables if TABLE is t. Alternativly, when TABLE is :default, the default caching action specified by *CACHE-TABLE-QUERIES-DEFAULT* is applied to all table for which a caching action has not been explicitly set.

COMMIT (&KEY (DATABASE *DEFAULT-DATABASE*))

If DATABASE, which defaults to *DEFAULT-DATABASE*, is currently within the scope of a transaction, commits changes made since the transaction began.

CONNECT (CONNECTION-SPEC &KEY (IF-EXISTS *CONNECT-IF-EXISTS*) (MAKE-DEFAULT T) (POOL NIL) (DATABASE-TYPE *DEFAULT-DATABASE-TYPE*) (ENCODING NIL))

Connects to a database of the supplied DATABASE-TYPE which defaults to *DEFAULT-DATABASE-TYPE*, using the type-specific connection specification CONNECTION-SPEC. The value of IF-EXISTS, which defaults to *CONNECT-IF-EXISTS*, determines what happens if a connection to the database specified by CONNECTION-SPEC is already established. A value of :new means create a new connection. A value of :warn-new means warn the user and create a new connect. A value of :warn-old means warn the user and use the old connection. A value of :error means fail, notifying the user. A value of :old means return the old connection. MAKE-DEFAULT is t by default which means that *DEFAULT-DATABASE* is set to the new connection, otherwise *DEFAULT-DATABASE* is not changed. If POOL is t the connection will be taken from the general pool, if POOL is a CONN-POOL object the connection will be taken from this pool.

CONNECTED-DATABASES

Returns the list of active database objects.

CREATE-DATABASE (CONNECTION-SPEC &KEY (DATABASE-TYPE *DEFAULT-DATABASE-TYPE*))

This function creates a database in the database system specified by DATABASE-TYPE.

CREATE-INDEX (NAME &KEY ON (UNIQUE NIL) ATTRIBUTES (DATABASE *DEFAULT-DATABASE*))

Creates an index called NAME on the table specified by ON in DATABASE which default to *DEFAULT-DATABASE*. The table attributes to use in constructing the index NAME are specified by ATTRIBUTES. The UNIQUE argument is nil by default but if it has a non-nil value then the indexed attributes must have unique values.

CREATE-SEQUENCE (NAME &KEY (DATABASE *DEFAULT-DATABASE*))

Creates a sequence called NAME in DATABASE which defaults to *DEFAULT-DATABASE*.

CREATE-TABLE (NAME DESCRIPTION &KEY (DATABASE *DEFAULT-DATABASE*) (CONSTRAINTS NIL) (TRANSACTIONS T))

Creates a table called NAME, which may be a string, symbol or SQL table identifier, in DATABASE which defaults to *DEFAULT-DATABASE*. DESCRIPTION is a list whose elements are lists containing the attribute names, types, and other constraints such as not-null or primary-key for each column in the table. CONSTRAINTS is a string representing an SQL table constraint expression or a list of such strings. With MySQL databases, if TRANSACTIONS is t an InnoDB table is created which supports transactions.

CREATE-VIEW (NAME &KEY AS COLUMN-LIST (WITH-CHECK-OPTION NIL) (DATABASE *DEFAULT-DATABASE*))

Creates a view called NAME in DATABASE which defaults to *DEFAULT-DATABASE*. The view is created using the query AS and the columns of the view may be specified using the COLUMN-LIST parameter. The WITH-CHECK-OPTION is nil by default but if it has a non-nil value, then all insert/update commands on the view are checked to ensure that the new data satisfy the query AS.

CREATE-VIEW-FROM-CLASS (VIEW-CLASS-NAME &KEY (DATABASE *DEFAULT-DATABASE*) (TRANSACTIONS T))

Creates a table as defined by the View Class VIEW-CLASS-NAME in DATABASE which defaults to *DEFAULT-DATABASE*.

DATE+ (DATE &REST DURATIONS)

Add each DURATION to DATE, returning a new date value. Note that (barring daylight saving time) 12h + 12h will result in a new day, but doing it as separate calculations will not, as the time is chopped to a date before being returned.

DATE- (DATE &REST DURATIONS)

Subtract each DURATION to DATE, returning a new date value. Note that (barring daylight saving time) 12h + 12h will result in a new day, but doing it as separate calculations will not, as the time is chopped to a date before being returned.

DATE-DIFFERENCE (DATE1 DATE2)

Returns a DURATION representing the difference between TIME1 and TIME2.

DATE-MJD (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DB-TIMESTRING (TIME &KEY STREAM)

return the string to store the given time in the database

DECODE-DATE (DATE)

returns the decoded date as multiple values: day month year integer day-of-week

DECODE-TIME (TIME)

returns the decoded time as multiple values: usec, second, minute, hour, day, month, year, integer day-of-week

DELETE-RECORDS (&KEY (FROM NIL) (WHERE NIL) (DATABASE *DEFAULT-DATABASE*))

Deletes records satisfying the SQL expression WHERE from the table specified by FROM in DATABASE specifies a database which defaults to *DEFAULT-DATABASE*.

DELETE-SQL-STREAM (STREAM &KEY (TYPE COMMANDS) (DATABASE *DEFAULT-DATABASE*))

Removes the supplied stream STREAM from the recording broadcast stream for the SQL recording type specified by TYPE on DATABASE which defaults to *DEFAULT-DATABASE*. TYPE must be one of :commands, :results, or :both, defaulting to :commands, depending on whether the stream is to be added for recording SQL commands, results or both.

DESTROY-DATABASE (CONNECTION-SPEC &KEY (DATABASE-TYPE *DEFAULT-DATABASE-TYPE*))

This function destroys a database in the database system specified by DATABASE-TYPE.

DISCONNECT (&KEY (DATABASE *DEFAULT-DATABASE*) (ERROR NIL))

Closes the connection to DATABASE and resets *DEFAULT-DATABASE* if that database was disconnected. If DATABASE is a database instance, this object is closed. If DATABASE is a string, then a connected database whose name matches DATABASE is sought in the list of connected databases. If no matching database is found and ERROR and DATABASE are both non-nil an error is signaled, otherwise nil is returned. If the database is from a pool it will be released to this pool.

DISCONNECT-POOLED (&OPTIONAL CLEAR)

Disconnects all connections in the pool. When clear, also deletes the pool objects.

DROP-INDEX (NAME &KEY (IF-DOES-NOT-EXIST ERROR) (ON NIL) (DATABASE *DEFAULT-DATABASE*))

Drops the index called NAME in DATABASE which defaults to *DEFAULT-DATABASE*. If the index does not exist and IF-DOES-NOT-EXIST is :ignore then DROP-INDEX returns nil whereas an error is signalled if IF-DOES-NOT-EXIST is :error. The argument ON allows the optional specification of a table to drop the index from.

DROP-SEQUENCE (NAME &KEY (IF-DOES-NOT-EXIST ERROR) (DATABASE *DEFAULT-DATABASE*))

Drops the sequence called NAME from DATABASE which defaults to *DEFAULT-DATABASE*. If the sequence does not exist and IF-DOES-NOT-EXIST is :ignore then DROP-SEQUENCE returns nil whereas an error is signalled if IF-DOES-NOT-EXIST is :error.

DROP-TABLE (NAME &KEY (IF-DOES-NOT-EXIST ERROR) (DATABASE *DEFAULT-DATABASE*) (OWNER NIL))

Drops the table called NAME from DATABASE which defaults to *DEFAULT-DATABASE*. If the table does not exist and IF-DOES-NOT-EXIST is :ignore then DROP-TABLE returns nil whereas an error is signalled if IF-DOES-NOT-EXIST is :error.

DROP-VIEW (NAME &KEY (IF-DOES-NOT-EXIST ERROR) (DATABASE *DEFAULT-DATABASE*))

Drops the view called NAME from DATABASE which defaults to *DEFAULT-DATABASE*. If the view does not exist and IF-DOES-NOT-EXIST is :ignore then DROP-VIEW returns nil whereas an error is signalled if IF-DOES-NOT-EXIST is :error.

DROP-VIEW-FROM-CLASS (VIEW-CLASS-NAME &KEY (DATABASE *DEFAULT-DATABASE*) (OWNER NIL))

Removes a table defined by the View Class VIEW-CLASS-NAME from DATABASE which defaults to *DEFAULT-DATABASE*.

DURATION+ (TIME &REST DURATIONS)

Add each DURATION to TIME, returning a new wall-time value.

DURATION-DAY (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DURATION-HOUR (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DURATION-MINUTE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DURATION-MONTH (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DURATION-SECOND (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DURATION-YEAR (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

FIND-DATABASE (DATABASE &KEY (ERRORP T) (DB-TYPE NIL))

Returns the connected databases of type DB-TYPE whose names match the string DATABASE. If DATABASE is a database object, it is returned. If DB-TYPE is nil all databases matching the string DATABASE are considered. If no matching databases are found and ERRORP is nil then nil is returned. If ERRORP is nil and one or more matching databases are found, then the most recently connected database is returned as a first value and the number of matching databases is returned as a second value. If no, or more than one, matching databases are found and ERRORP is true, an error is signalled.

FORMAT-DATE (STREAM DATE &KEY FORMAT (DATE-SEPARATOR -) (INTERNAL-SEPARATOR ))

produces on stream the datestring corresponding to the date with the given options

FORMAT-TIME (STREAM TIME &KEY FORMAT (DATE-SEPARATOR -) (TIME-SEPARATOR :) (INTERNAL-SEPARATOR ))

produces on stream the timestring corresponding to the wall-time with the given options

FREE-PREPARED-SQL (PREPARED-STMT)

Delete the objects associated with a prepared statement.

GET-DATE

Returns a date for today

GET-TIME

Return a pair: (GREGORIAN DAY . TIME-OF-DAY)

IN-TRANSACTION-P (&KEY (DATABASE *DEFAULT-DATABASE*))

A predicate to test whether DATABASE, which defaults to *DEFAULT-DATABASE*, is currently within the scope of a transaction.

INDEX-EXISTS-P (NAME &KEY (OWNER NIL) (DATABASE *DEFAULT-DATABASE*))

Tests for the existence of an SQL index called NAME in DATABASE which defaults to *DEFAULT-DATABASE*. OWNER is nil by default which means that only indexes owned by users are examined. If OWNER is a string denoting a user name, only indexes owned by OWNER are examined. If OWNER is :all then all indexes are examined.

INITIALIZE-DATABASE-TYPE (&KEY (DATABASE-TYPE *DEFAULT-DATABASE-TYPE*))

Initializes the supplied DATABASE-TYPE, if it is not already initialized, as indicated by *INITIALIZED-DATABASE-TYPES* and returns DATABASE-TYPE. *DEFAULT-DATABASE-TYPE* is set to DATABASE-TYPE and, if DATABASE-TYPE has not been initialised, it is added to *INITIALIZED-DATABASE-TYPES*.

INSERT-RECORDS (&KEY (INTO NIL) (ATTRIBUTES NIL) (VALUES NIL) (AV-PAIRS NIL) (QUERY NIL) (DATABASE *DEFAULT-DATABASE*))

Inserts records into the table specified by INTO in DATABASE which defaults to *DEFAULT-DATABASE*. There are five ways of specifying the values inserted into each row. In the first VALUES contains a list of values to insert and ATTRIBUTES, AV-PAIRS and QUERY are nil. This can be used when values are supplied for all attributes in INTO. In the second, ATTRIBUTES is a list of column names, VALUES is a corresponding list of values and AV-PAIRS and QUERY are nil. In the third, ATTRIBUTES, VALUES and QUERY are nil and AV-PAIRS is a list of (attribute value) pairs, or attribute-value-pair objects. In the fourth, VALUES, AV-PAIRS and ATTRIBUTES are nil and QUERY is a symbolic SQL query expression in which the selected columns also exist in INTO. In the fifth method, VALUES and AV-PAIRS are nil and ATTRIBUTES is a list of column names and QUERY is a symbolic SQL query expression which returns values for the specified columns.

INTERVAL-CONTAINED (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

INTERVAL-DATA (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

INTERVAL-EDIT (LIST TIME START END &OPTIONAL TAG)

Attempts to modify the most deeply nested interval in list which begins at time. If no changes are made, returns nil.

INTERVAL-END (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

INTERVAL-MATCH (LIST TIME)

Return the index of the first interval in list containing time

INTERVAL-RELATION (X Y)

Compare the relationship of node x to node y. Returns either :contained :contains :follows :overlaps or :precedes.

INTERVAL-START (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

INTERVAL-TYPE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

LIST-ATTRIBUTE-TYPES (TABLE &KEY (OWNER NIL) (DATABASE *DEFAULT-DATABASE*))

Returns a list containing information about the SQL types of each of the attributes in the table specified by TABLE in DATABASE which has a default value of *DEFAULT-DATABASE*. OWNER is nil by default which means that only attributes owned by users are listed. If OWNER is a string denoting a user name, only attributes owned by OWNER are listed. If OWNER is :all then all attributes are listed. The elements of the returned list are lists where the first element is the name of the attribute, the second element is its SQL type, the third is the type precision, the fourth is the scale of the attribute and the fifth is 1 if the attribute accepts null values and otherwise 0.

LIST-ATTRIBUTES (NAME &KEY (OWNER NIL) (DATABASE *DEFAULT-DATABASE*))

Returns a list of strings representing the attributes of table NAME in DATABASE which defaults to *DEFAULT-DATABASE*. OWNER is nil by default which means that only attributes owned by users are listed. If OWNER is a string denoting a user name, only attributes owned by OWNER are listed. If OWNER is :all then all attributes are listed.

LIST-CLASSES (&KEY (TEST #'IDENTITY) (ROOT-CLASS (FIND-CLASS 'STANDARD-DB-OBJECT)) (DATABASE *DEFAULT-DATABASE*))

Returns a list of all the View Classes which are connected to DATABASE, which defaults to *DEFAULT-DATABASE*, and which descend from the class ROOT-CLASS and which satisfy the function TEST. By default ROOT-CLASS is STANDARD-DB-OBJECT and TEST is IDENTITY.

LIST-DATABASES (CONNECTION-SPEC &KEY (DATABASE-TYPE *DEFAULT-DATABASE-TYPE*))

This function returns a list of databases existing in the database system specified by DATABASE-TYPE.

LIST-INDEXES (&KEY (OWNER NIL) (DATABASE *DEFAULT-DATABASE*) (ON NIL))

Returns a list of strings representing index names in DATABASE which defaults to *DEFAULT-DATABASE*. OWNER is nil by default which means that only indexes owned by users are listed. If OWNER is a string denoting a user name, only indexes owned by OWNER are listed. If OWNER is :all then all indexes are listed. The keyword argument ON limits the results to indexes on the specified tables. Meaningful values for ON are nil (the default) which means that all tables are considered, a string, symbol or SQL expression representing a table name in DATABASE or a list of such table identifiers.

LIST-SEQUENCES (&KEY (OWNER NIL) (DATABASE *DEFAULT-DATABASE*))

Returns a list of strings representing sequence names in DATABASE which defaults to *DEFAULT-DATABASE*. OWNER is nil by default which means that only sequences owned by users are listed. If OWNER is a string denoting a user name, only sequences owned by OWNER are listed. If OWNER is :all then all sequences are listed.

LIST-SQL-STREAMS (&KEY (TYPE COMMANDS) (DATABASE *DEFAULT-DATABASE*))

Returns the list of component streams for the broadcast stream recording SQL commands sent to and/or results returned from DATABASE which defaults to *DEFAULT-DATABASE*. TYPE must be one of :commands, :results, or :both, defaulting to :commands, and determines whether the listed streams contain those recording SQL commands, results or both.

LIST-TABLES (&KEY (OWNER NIL) (DATABASE *DEFAULT-DATABASE*))

Returns a list of strings representing table names in DATABASE which defaults to *DEFAULT-DATABASE*. OWNER is nil by default which means that only tables owned by users are listed. If OWNER is a string denoting a user name, only tables owned by OWNER are listed. If OWNER is :all then all tables are listed.

LIST-VIEWS (&KEY (OWNER NIL) (DATABASE *DEFAULT-DATABASE*))

Returns a list of strings representing view names in DATABASE which defaults to *DEFAULT-DATABASE*. OWNER is nil by default which means that only views owned by users are listed. If OWNER is a string denoting a user name, only views owned by OWNER are listed. If OWNER is :all then all views are listed.

MAP-QUERY (OUTPUT-TYPE-SPEC FUNCTION QUERY-EXPRESSION &KEY (DATABASE *DEFAULT-DATABASE*) (RESULT-TYPES AUTO))

Map the function FUNCTION over the attribute values of each row selected by the SQL query QUERY-EXPRESSION, which may be a string or a symbolic SQL expression, in DATABASE which defaults to *DEFAULT-DATABASE*. The results of the function are collected as specified in OUTPUT-TYPE-SPEC and returned like in MAP. RESULT-TYPES is a list of symbols which specifies the lisp type for each field returned by QUERY-EXPRESSION. If RESULT-TYPES is nil all results are returned as strings whereas the default value of :auto means that the lisp types are automatically computed for each field.

PARSE-DATE-TIME (STRING)

parses date like 08/08/01, 8.8.2001, eg

PARSE-DATESTRING (DATESTRING &KEY (START 0) END JUNK-ALLOWED)

parse a ISO 8601 timestring and return the corresponding date. Will throw a hissy fit if the date string is a duration. Will ignore any precision beyond day (hour/min/sec/usec).

PARSE-TIMESTRING (TIMESTRING &KEY (START 0) END JUNK-ALLOWED)

parse a timestring and return the corresponding wall-time. If the timestring starts with P, read a duration; otherwise read an ISO 8601 formatted date string.

PREPARE-SQL (SQL-STMT TYPES &KEY (DATABASE *DEFAULT-DATABASE*) (RESULT-TYPES AUTO) FIELD-NAMES)

Prepares a SQL statement for execution. TYPES contains a list of types corresponding to the input parameters. Returns a prepared-statement object. A type can be :int :double :null (:blob n) (:string n)

PROBE-DATABASE (CONNECTION-SPEC &KEY (DATABASE-TYPE *DEFAULT-DATABASE-TYPE*))

This function tests for the existence of a database in the database system specified by DATABASE-TYPE.

PUSH-LIBRARY-PATH (PATH)

Adds the pathspec PATH (which should denote a directory) to the list *FOREIGN-LIBRARY-SEARCH-PATHS*.

RECONNECT (&KEY (DATABASE *DEFAULT-DATABASE*) (ERROR NIL) (FORCE T))

Reconnects DATABASE which defaults to *DEFAULT-DATABASE* to the underlying database management system. On success, t is returned and the variable *DEFAULT-DATABASE* is set to the newly reconnected database. If DATABASE is a database instance, this object is closed. If DATABASE is a string, then a connected database whose name matches DATABASE is sought in the list of connected databases. If no matching database is found and ERROR and DATABASE are both non-nil an error is signaled, otherwise nil is returned. When the current database connection cannot be closed, if FORCE is non-nil, as it is by default, the connection is closed and errors are suppressed. If force is nil and the database connection cannot be closed, an error is signalled.

ROLLBACK (&KEY (DATABASE *DEFAULT-DATABASE*))

If DATABASE, which defaults to *DEFAULT-DATABASE*, is currently within the scope of a transaction, rolls back changes made since the transaction began.

RUN-PREPARED-SQL (PREPARED-STMT)

Execute the prepared sql statment. All input parameters must be bound.

SELECT (&REST SELECT-ALL-ARGS)

Executes a query on DATABASE, which has a default value of *DEFAULT-DATABASE*, specified by the SQL expressions supplied using the remaining arguments in SELECT-ALL-ARGS. The SELECT argument can be used to generate queries in both functional and object oriented contexts. In the functional case, the required arguments specify the columns selected by the query and may be symbolic SQL expressions or strings representing attribute identifiers. Type modified identifiers indicate that the values selected from the specified column are converted to the specified lisp type. The keyword arguments ALL, DISTINCT, FROM, GROUP-by, HAVING, ORDER-BY, SET-OPERATION and WHERE are used to specify, using the symbolic SQL syntax, the corresponding components of the SQL query generated by the call to SELECT. RESULT-TYPES is a list of symbols which specifies the lisp type for each field returned by the query. If RESULT-TYPES is nil all results are returned as strings whereas the default value of :auto means that the lisp types are automatically computed for each field. FIELD-NAMES is t by default which means that the second value returned is a list of strings representing the columns selected by the query. If FIELD-NAMES is nil, the list of column names is not returned as a second value. In the object oriented case, the required arguments to SELECT are symbols denoting View Classes which specify the database tables to query. In this case, SELECT returns a list of View Class instances whose slots are set from the attribute values of the records in the specified table. Slot-value is a legal operator which can be employed as part of the symbolic SQL syntax used in the WHERE keyword argument to SELECT. REFRESH is nil by default which means that the View Class instances returned are retrieved from a cache if an equivalent call to SELECT has previously been issued. If REFRESH is true, the View Class instances returned are updated as necessary from the database and the generic function INSTANCE-REFRESHED is called to perform any necessary operations on the updated instances. In both object oriented and functional contexts, FLATP has a default value of nil which means that the results are returned as a list of lists. If FLATP is t and only one result is returned for each record selected in the query, the results are returned as elements of a list.

SEQUENCE-EXISTS-P (NAME &KEY (OWNER NIL) (DATABASE *DEFAULT-DATABASE*))

Tests for the existence of an SQL sequence called NAME in DATABASE which defaults to *DEFAULT-DATABASE*. OWNER is nil by default which means that only sequences owned by users are examined. If OWNER is a string denoting a user name, only sequences owned by OWNER are examined. If OWNER is :all then all sequences are examined.

SEQUENCE-LAST (NAME &KEY (DATABASE *DEFAULT-DATABASE*))

Return the last value allocated in the sequence called NAME in DATABASE which defaults to *DEFAULT-DATABASE*.

SEQUENCE-NEXT (NAME &KEY (DATABASE *DEFAULT-DATABASE*))

Increment and return the next value in the sequence called NAME in DATABASE which defaults to *DEFAULT-DATABASE*.

SET-AUTOCOMMIT (VALUE &KEY (DATABASE *DEFAULT-DATABASE*))

Turns autocommit off for DATABASE if VALUE is NIL, and otherwise turns it on. Returns the old value of autocommit flag. For RDBMS (such as Oracle) which don't automatically commit changes, turning autocommit on has the effect of explicitly committing changes made whenever SQL statements are executed. Autocommit is turned on by default.

SET-SEQUENCE-POSITION (NAME POSITION &KEY (DATABASE *DEFAULT-DATABASE*))

Explicitly set the the position of the sequence called NAME in DATABASE, which defaults to *DEFAULT-DATABASE*, to POSITION which is returned.

SQL (&REST ARGS)

Returns an SQL string generated from the expressions ARGS. The expressions are translated into SQL strings and then concatenated with a single space delimiting each expression. An error of type SQL-USER-ERROR is signalled if any element in ARGS is not of the supported types (a symbol, string, number or symbolic SQL expression) or a list or vector containing only these supported types.

SQL-EXPRESSION (&KEY STRING TABLE ALIAS ATTRIBUTE TYPE)

Returns an SQL expression constructed from the supplied arguments which may be combined as follows: ATTRIBUTE and TYPE; ATTRIBUTE; ALIAS or TABLE and ATTRIBUTE and TYPE; ALIAS or TABLE and ATTRIBUTE; TABLE, ATTRIBUTE and TYPE; TABLE and ATTRIBUTE; TABLE and ALIAS; TABLE; and STRING. An error of type SQL-USER-ERROR is signalled if an unsupported combination of keyword arguments is specified.

SQL-OPERATION (OPERATOR &REST ARGS)

Returns an SQL expression constructed from the supplied symbol OPERATOR representing an SQL operator or function and its arguments ARGS. An error of type SQL-USER-ERROR is signalled if OPERATOR is not a symbol representing a supported SQL operator. If OPERATOR is passed the symbol FUNCTION then the first value in ARGS must be a string representing a valid SQL function and the remaining values in ARGS its arguments as strings.

SQL-OPERATOR (OPERATOR)

Returns the Lisp symbol corresponding to the SQL operator represented by the symbol OPERATOR. If OPERATOR does not represent a supported SQL operator or is not a symbol, nil is returned.

SQL-RECORDING-P (&KEY (TYPE COMMANDS) (DATABASE *DEFAULT-DATABASE*))

Predicate to test whether the SQL recording specified by TYPE is currently enabled for DATABASE which defaults to *DEFAULT-DATABASE*. TYPE may be one of :commands, :results, :both or :either, defaulting to :commands, otherwise nil is returned.

SQL-STREAM (&KEY (TYPE COMMANDS) (DATABASE *DEFAULT-DATABASE*))

Returns the broadcast stream used for recording SQL commands sent to or results returned from DATABASE which defaults to *DEFAULT-DATABASE*. TYPE must be one of :commands or :results, defaulting to :commands, and determines whether the stream returned is that used for recording SQL commands or results.

START-SQL-RECORDING (&KEY (TYPE COMMANDS) (DATABASE *DEFAULT-DATABASE*))

Starts recording of SQL commands sent to and/or results returned from DATABASE which defaults to *DEFAULT-DATABASE*. The SQL is output on one or more broadcast streams, initially just *STANDARD-OUTPUT*, and the functions ADD-SQL-STREAM and DELETE-SQL-STREAM may be used to add or delete command or result recording streams. The default value of TYPE is :commands which means that SQL commands sent to DATABASE are recorded. If TYPE is :results then SQL results returned from DATABASE are recorded. Both commands and results may be recorded by passing TYPE value of :both.

START-TRANSACTION (&KEY (DATABASE *DEFAULT-DATABASE*))

Starts a transaction block on DATABASE which defaults to *DEFAULT-DATABASE* and which continues until ROLLBACK or COMMIT are called.

STATUS (&OPTIONAL FULL)

Prints information about the currently connected databases to *STANDARD-OUTPUT*. The argument FULL is nil by default and a value of t means that more detailed information about each database is printed.

STOP-SQL-RECORDING (&KEY (TYPE COMMANDS) (DATABASE *DEFAULT-DATABASE*))

Stops recording of SQL commands sent to and/or results returned from DATABASE which defaults to *DEFAULT-DATABASE*. The default value of TYPE is :commands which means that SQL commands sent to DATABASE will no longer be recorded. If TYPE is :results then SQL results returned from DATABASE will no longer be recorded. Recording may be stopped for both commands and results by passing TYPE value of :both.

TABLE-EXISTS-P (NAME &KEY (OWNER NIL) (DATABASE *DEFAULT-DATABASE*))

Tests for the existence of an SQL table called NAME in DATABASE which defaults to *DEFAULT-DATABASE*. OWNER is nil by default which means that only tables owned by users are examined. If OWNER is a string denoting a user name, only tables owned by OWNER are examined. If OWNER is :all then all tables are examined.

TIME+ (TIME &REST DURATIONS)

Add each DURATION to TIME, returning a new wall-time value.

TIME- (TIME &REST DURATIONS)

Subtract each DURATION from TIME, returning a new wall-time value.

TIME-DIFFERENCE (TIME1 TIME2)

Returns a DURATION representing the difference between TIME1 and TIME2.

TIME-DOW (TIME)

Return the 0 indexed Day of the week starting with Sunday

TIME-MAX (NUMBER &REST MORE-NUMBERS)

Returns the greatest of its arguments.

TIME-MIN (NUMBER &REST MORE-NUMBERS)

Returns the least of its arguments.

TIME-MJD (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

TIME< (NUMBER &REST MORE-NUMBERS)

Returns T if its arguments are in strictly increasing order, NIL otherwise.

TIME<= (NUMBER &REST MORE-NUMBERS)

Returns T if arguments are in strictly non-decreasing order, NIL otherwise.

TIME= (NUMBER &REST MORE-NUMBERS)

Returns T if all of its arguments are numerically equal, NIL otherwise.

TIME> (NUMBER &REST MORE-NUMBERS)

Returns T if its arguments are in strictly decreasing order, NIL otherwise.

TIME>= (NUMBER &REST MORE-NUMBERS)

Returns T if arguments are in strictly non-increasing order, NIL otherwise.

TRUNCATE-DATABASE (&KEY (DATABASE *DEFAULT-DATABASE*))

Drops all tables, views, indexes and sequences in DATABASE which defaults to *DEFAULT-DATABASE*.

UPDATE-OBJECTS-JOINS (OBJECTS &KEY (SLOTS IMMEDIATE) (FORCE-P T) CLASS-NAME (MAX-LEN *DEFAULT-UPDATE-OBJECTS-MAX-LEN*))

Updates from the records of the appropriate database tables the join slots specified by SLOTS in the supplied list of View Class instances OBJECTS. A simpler method of causing a join-slot to be requeried is to set it to unbound, then request it again. This function has efficiency gains where join-objects are shared among the `objects` (querying all join-objects, then attaching them appropriately to each of the `objects`) SLOTS can be one of: * :immediate (DEFAULT) - refresh join slots created with :retrieval :immediate * :deferred - refresh join slots created with :retrieval :deferred * :all,t - refresh all join slots regardless of :retrieval * list of symbols - which explicit slots to refresh * a single symobl - what slot to refresh CLASS-NAME is used to specify the View Class of all instance in OBJECTS and default to nil which means that the class of the first instance in OBJECTS is used. FORCE-P is t by default which means that all join slots are updated whereas a value of nil means that only unbound join slots are updated. MAX-LEN defaults to *DEFAULT-UPDATE-OBJECTS-MAX-LEN* When non-nil this is essentially a batch size for the max number of objects to query from the database at a time. If we need more than max-len we loop till we have all the objects

UPDATE-RECORDS (TABLE &KEY (ATTRIBUTES NIL) (VALUES NIL) (AV-PAIRS NIL) (WHERE NIL) (DATABASE *DEFAULT-DATABASE*))

Updates the attribute values of existing records satsifying the SQL expression WHERE in the table specified by TABLE in DATABASE which defaults to *DEFAULT-DATABASE*. There are three ways of specifying the values to update for each row. In the first, VALUES contains a list of values to use in the update and ATTRIBUTES and AV-PAIRS are nil. This can be used when values are supplied for all attributes in TABLE. In the second, ATTRIBUTES is a list of column names, VALUES is a corresponding list of values and AV-PAIRS is nil. In the third, ATTRIBUTES and VALUES are nil and AV-PAIRS is an alist of (attribute value) pairs.

UTIME->TIME (UTIME)

Return a pair: (GREGORIAN DAY . TIME-OF-DAY)

VIEW-EXISTS-P (NAME &KEY (OWNER NIL) (DATABASE *DEFAULT-DATABASE*))

Tests for the existence of an SQL view called NAME in DATABASE which defaults to *DEFAULT-DATABASE*. OWNER is nil by default which means that only views owned by users are examined. If OWNER is a string denoting a user name, only views owned by OWNER are examined. If OWNER is :all then all views are examined.

WRITE-INSTANCE-TO-STREAM (OBJ STREAM)

Writes an instance to a stream where it can be later be read. NOTE: an error will occur if a slot holds a value which can not be written readably.

Undocumented

CURRENT-DAY

CURRENT-MONTH

CURRENT-YEAR

DATE-COMPARE (DATE-A DATE-B)

DATE-DOW (DATE)

DATE-ELEMENT (DATE ELEMENT)

DATE-MAX (NUMBER &REST MORE-NUMBERS)

DATE-MIN (NUMBER &REST MORE-NUMBERS)

SETFDATE-MJD (NEW-VALUE INSTANCE)

DATE-P (OBJECT)

DATE-YMD (DATE)

DATE< (NUMBER &REST MORE-NUMBERS)

DATE<= (NUMBER &REST MORE-NUMBERS)

DATE= (NUMBER &REST MORE-NUMBERS)

DATE> (NUMBER &REST MORE-NUMBERS)

DATE>= (NUMBER &REST MORE-NUMBERS)

DB-DATESTRING (DATE)

SETFDURATION-DAY (NEW-VALUE INSTANCE)

SETFDURATION-HOUR (NEW-VALUE INSTANCE)

SETFDURATION-MINUTE (NEW-VALUE INSTANCE)

SETFDURATION-MONTH (NEW-VALUE INSTANCE)

DURATION-REDUCE (DURATION PRECISION &OPTIONAL ROUND)

SETFDURATION-SECOND (NEW-VALUE INSTANCE)

DURATION-TIMESTRING (DURATION)

SETFDURATION-YEAR (NEW-VALUE INSTANCE)

DURATION< (DURATION-A DURATION-B)

DURATION<= (DURATION-A DURATION-B)

DURATION= (DURATION-A DURATION-B)

DURATION> (X Y)

DURATION>= (X Y)

EXTRACT-ROMAN (STRING &AUX PARSE)

FORMAT-DURATION (STREAM DURATION &KEY (PRECISION MINUTE))

GREGORIAN-TO-MJD (MONTH DAY YEAR)

INTERVAL-CLEAR (LIST TIME)

SETFINTERVAL-CONTAINED (NEW-VALUE INSTANCE)

SETFINTERVAL-DATA (NEW-VALUE INSTANCE)

SETFINTERVAL-END (NEW-VALUE INSTANCE)

INTERVAL-PUSH (INTERVAL-LIST INTERVAL &OPTIONAL CONTAINER-RULE)

SETFINTERVAL-START (NEW-VALUE INSTANCE)

SETFINTERVAL-TYPE (NEW-VALUE INSTANCE)

ISO-TIMESTRING (TIME &KEY STREAM)

MAKE-DATE (&KEY (YEAR 0) (MONTH 1) (DAY 1) (HOUR 0) (MINUTE 0) (SECOND 0) (USEC 0) (OFFSET 0))

MAKE-DURATION (&KEY (YEAR 0) (MONTH 0) (DAY 0) (HOUR 0) (MINUTE 0) (SECOND 0) (USEC 0))

MAKE-INTERVAL (&KEY ((START DUM1208) NIL) ((END DUM1209) NIL) ((NAME DUM1210) NIL) ((CONTAINED DUM1211) NIL) ((TYPE DUM1212) NIL) ((DATA DUM1213) NIL))

MAKE-TIME (&KEY (YEAR 0) (MONTH 1) (DAY 1) (HOUR 0) (MINUTE 0) (SECOND 0) (USEC 0) (OFFSET 0))

MERGED-TIME (DAY TIME-OF-DAY)

MJD-TO-GREGORIAN (MJD)

MONTH-NAME (MONTH-INDEX)

PARSE-YEARSTRING (STRING)

READ-INSTANCE-FROM-STREAM (STREAM)

ROLL (DATE &KEY (YEAR 0) (MONTH 0) (DAY 0) (SECOND 0) (HOUR 0) (MINUTE 0) (USEC 0) (DESTRUCTIVE NIL))

ROLL-TO (DATE SIZE POSITION)

SQL-* (&REST REST)

SQL-+ (&REST REST)

SQL-- (&REST REST)

SQL-/ (&REST REST)

SQL-< (&REST REST)

SQL-<= (&REST REST)

SQL-<> (&REST REST)

SQL-= (&REST REST)

SQL-== (&REST REST)

SQL-> (&REST REST)

SQL->= (&REST REST)

SQL-ALL (&REST REST)

SQL-AND (&REST REST)

SQL-ANY (&REST REST)

SQL-AVG (&REST REST)

SQL-BETWEEN (&REST REST)

SQL-COALESCE (&REST REST)

SQL-CONCAT (&REST REST)

SQL-CONCAT-OP (&REST REST)

SQL-COUNT (&REST REST)

SQL-DISTINCT (&REST REST)

SQL-EXCEPT (&REST REST)

SQL-EXISTS (&REST REST)

SQL-FUNCTION (&REST ARGS)

SQL-GROUP-BY (&REST REST)

SQL-HAVING (&REST REST)

SQL-IN (&REST REST)

SQL-INTERSECT (&REST REST)

SQL-IS (&REST REST)

SQL-LIKE (&REST REST)

SQL-LIMIT (&REST REST)

SQL-MAX (&REST REST)

SQL-MIN (&REST REST)

SQL-MINUS (&REST REST)

SQL-NOT (&REST REST)

SQL-NOT-NULL (&OPTIONAL NOT-NULL-THING)

SQL-NULL (&OPTIONAL NOT-NULL-THING)

SQL-NVL (&REST REST)

SQL-OR (&REST REST)

SQL-ORDER-BY (&REST REST)

SQL-QUERY (&REST ARGS)

SQL-SLOT-VALUE (CLASSNAME SLOT &OPTIONAL (VALUE +NO-SLOT-VALUE+) (DATABASE *DEFAULT-DATABASE*))

SQL-SOME (&REST REST)

SQL-SUBSTR (&REST REST)

SQL-SUBSTRING (&REST REST)

SQL-SUM (&REST REST)

SQL-THE (&REST REST)

SQL-UNION (&REST REST)

SQL-UPLIKE (&REST REST)

SQL-USERENV (&REST REST)

SQL-VIEW-CLASS (CLASSNAME &OPTIONAL (DATABASE *DEFAULT-DATABASE*))

TIME-COMPARE (TIME-A TIME-B)

TIME-ELEMENT (TIME ELEMENT)

SETFTIME-MJD (NEW-VALUE INSTANCE)

TIME-YMD (TIME)

WEEK-CONTAINING (TIME)

MACRO

Public

DEF-VIEW-CLASS (CLASS SUPERS SLOTS &REST CL-OPTIONS)

Creates a View Class called CLASS whose slots SLOTS can map onto the attributes of a table in a database. If SUPERS is nil then the superclass of CLASS will be STANDARD-DB-OBJECT, otherwise SUPERS is a list of superclasses for CLASS which must include STANDARD-DB-OBJECT or a descendent of this class. The syntax of DEFCLASS is extended through the addition of a class option :base-table which defines the database table onto which the View Class maps and which defaults to CLASS. The DEFCLASS syntax is also extended through additional slot options. The :db-kind slot option specifies the kind of DB mapping which is performed for this slot and defaults to :base which indicates that the slot maps to an ordinary column of the database table. A :db-kind value of :key indicates that this slot is a special kind of :base slot which maps onto a column which is one of the unique keys for the database table, the value :join indicates this slot represents a join onto another View Class which contains View Class objects, and the value :virtual indicates a standard CLOS slot which does not map onto columns of the database table. If a slot is specified with :db-kind :join, the slot option :db-info contains a list which specifies the nature of the join. For slots of :db-kind :base or :key, the :type slot option has a special interpretation such that Lisp types, such as string, integer and float are automatically converted into appropriate SQL types for the column onto which the slot maps. This behaviour may be over-ridden using the :db-type slot option which is a string specifying the vendor-specific database type for this slot's column definition in the database. The :column slot option specifies the name of the SQL column which the slot maps onto, if :db-kind is not :virtual, and defaults to the slot name. The :void-value slot option specifies the value to store if the SQL value is NULL and defaults to NIL. The :db-constraints slot option is a string representing an SQL table constraint expression or a list of such strings.

DISABLE-SQL-READER-SYNTAX

Turns off the SQL reader syntax setting the syntax state such that if the syntax is subsequently enabled, RESTORE-SQL-READER-SYNTAX-STATE will disable it again.

DO-QUERY (((&REST ARGS) QUERY-EXPRESSION &KEY (DATABASE '*DEFAULT-DATABASE*) (RESULT-TYPES AUTO)) &BODY BODY)

Repeatedly executes BODY within a binding of ARGS on the fields of each row selected by the SQL query QUERY-EXPRESSION, which may be a string or a symbolic SQL expression, in DATABASE which defaults to *DEFAULT-DATABASE*. The values returned by the execution of BODY are returned. RESULT-TYPES is a list of symbols which specifies the lisp type for each field returned by QUERY-EXPRESSION. If RESULT-TYPES is nil all results are returned as strings whereas the default value of :auto means that the lisp types are automatically computed for each field.

ENABLE-SQL-READER-SYNTAX

Turns on the SQL reader syntax setting the syntax state such that if the syntax is subsequently disabled, RESTORE-SQL-READER-SYNTAX-STATE will enable it again.

FILE-ENABLE-SQL-READER-SYNTAX

Turns on the SQL reader syntax for the rest of the file. The CL spec says that when finished loading a file the original *readtable* is restored. clhs COMPILE-FILE

LOCALLY-DISABLE-SQL-READER-SYNTAX

Turns off the SQL reader syntax without changing the syntax state such that RESTORE-SQL-READER-SYNTAX-STATE will re-establish the current syntax state.

LOCALLY-ENABLE-SQL-READER-SYNTAX

Turns on the SQL reader syntax without changing the syntax state such that RESTORE-SQL-READER-SYNTAX-STATE will re-establish the current syntax state.

RESTORE-SQL-READER-SYNTAX-STATE

Enables the SQL reader syntax if ENABLE-SQL-READER-SYNTAX has been called more recently than DISABLE-SQL-READER-SYNTAX and otherwise disables the SQL reader syntax. By default, the SQL reader syntax is disabled.

TIME (FORM)

Execute FORM and print timing information on *TRACE-OUTPUT*. On some hardware platforms estimated processor cycle counts are included in this output; this number is slightly inflated, since it includes the pipeline involved in reading the cycle counter -- executing (TIME NIL) a few times will give you an idea of the overhead, and its variance. The cycle counters are also per processor, not per thread: if multiple threads are running on the same processor, the reported counts will include cycles taken up by all threads running on the processor where TIME was executed. Furthermore, if the operating system migrates the thread to another processor between reads of the cycle counter, the results will be completely bogus. Finally, the counter is cycle counter, incremented by the hardware even when the process is halted -- which is to say that cycles pass normally during operations like SLEEP.

WITH-DATABASE ((DB-VAR CONNECTION-SPEC &KEY MAKE-DEFAULT POOL (IF-EXISTS *CONNECT-IF-EXISTS*) (DATABASE-TYPE *DEFAULT-DATABASE-TYPE*) (ENCODING NIL)) &BODY BODY)

Evaluate the body in an environment, where DB-VAR is bound to the database connection given by CONNECTION-SPEC and CONNECT-ARGS. The connection is automatically closed or released to the pool on exit from the body. MAKE-DEFAULT has a default value of NIL.

WITH-DEFAULT-DATABASE ((DATABASE) &REST BODY)

Perform BODY with DATABASE bound as *default-database*.

WITH-TRANSACTION ((&KEY (DATABASE '*DEFAULT-DATABASE*)) &BODY BODY)

Starts a transaction in the database specified by DATABASE, which is *DEFAULT-DATABASE* by default, and executes BODY within that transaction. If BODY aborts or throws, DATABASE is rolled back and otherwise the transaction is committed.

Undocumented

LOOP (&ENVIRONMENT ENV &REST KEYWORDS-AND-FORMS)

GENERIC-FUNCTION

Public

DATABASE-NAME-FROM-SPEC (CONNECTION-SPEC DATABASE-TYPE)

Returns the name of the database that would be created if connect was called with the connection-spec.

DELETE-INSTANCE-RECORDS (OBJECT &KEY DATABASE)

Deletes the records represented by OBJECT in the appropriate table of the database associated with OBJECT. If OBJECT is not yet associated with a database, an error is signalled.

EXECUTE-COMMAND (EXPRESSION &KEY DATABASE (DATABASE *DEFAULT-DATABASE*))

Executes the SQL command EXPRESSION, which may be an SQL expression or a string representing any SQL statement apart from a query, on the supplied DATABASE which defaults to *DEFAULT-DATABASE*.

INSTANCE-REFRESHED (OBJECT)

Provides a hook which is called within an object oriented call to SELECT with a non-nil value of REFRESH when the View Class instance OBJECT has been updated from the database. A method specialised on STANDARD-DB-OBJECT is provided which has no effects. Methods specialised on particular View Classes can be used to specify any operations that need to be made on View Classes instances which have been updated in calls to SELECT.

QUERY (QUERY-EXPRESSION &KEY DATABASE RESULT-TYPES FLATP FIELD-NAMES (FIELD-NAMES T) (FLATP NIL) (RESULT-TYPES AUTO) (DATABASE *DEFAULT-DATABASE*))

Executes the SQL query expression QUERY-EXPRESSION, which may be an SQL expression or a string, on the supplied DATABASE which defaults to *DEFAULT-DATABASE*. RESULT-TYPES is a list of symbols which specifies the lisp type for each field returned by QUERY-EXPRESSION. If RESULT-TYPES is nil all results are returned as strings whereas the default value of :auto means that the lisp types are automatically computed for each field. FIELD-NAMES is t by default which means that the second value returned is a list of strings representing the columns selected by QUERY-EXPRESSION. If FIELD-NAMES is nil, the list of column names is not returned as a second value. FLATP has a default value of nil which means that the results are returned as a list of lists. If FLATP is t and only one result is returned for each record selected by QUERY-EXPRESSION, the results are returned as elements of a list.

UPDATE-INSTANCE-FROM-RECORDS (OBJECT &KEY DATABASE (DATABASE *DEFAULT-DATABASE*))

Updates the slot values of the View Class instance OBJECT using the attribute values of the appropriate table of DATABASE which defaults to the database associated with OBJECT or, if OBJECT is not associated with a database, *DEFAULT-DATABASE*. Join slots are updated but instances of the class on which the join is made are not updated.

UPDATE-RECORD-FROM-SLOT (OBJECT SLOT &KEY DATABASE (DATABASE *DEFAULT-DATABASE*))

Updates the value stored in the column represented by the slot, specified by the CLOS slot name SLOT, of View Class instance OBJECT. DATABASE defaults to *DEFAULT-DATABASE* and specifies the database in which the update is made only if OBJECT is not associated with a database. In this case, a record is created in DATABASE and the attribute represented by SLOT is initialised from the value of the supplied slots with other attributes having default values. Furthermore, OBJECT becomes associated with DATABASE.

UPDATE-RECORD-FROM-SLOTS (OBJECT SLOTS &KEY DATABASE (DATABASE *DEFAULT-DATABASE*))

Updates the values stored in the columns represented by the slots, specified by the CLOS slot names SLOTS, of View Class instance OBJECT. DATABASE defaults to *DEFAULT-DATABASE* and specifies the database in which the update is made only if OBJECT is not associated with a database. In this case, a record is created in the appropriate table of DATABASE and the attributes represented by SLOTS are initialised from the values of the supplied slots with other attributes having default values. Furthermore, OBJECT becomes associated with DATABASE.

UPDATE-RECORDS-FROM-INSTANCE (OBJECT &KEY DATABASE (DATABASE *DEFAULT-DATABASE*))

Using an instance of a View Class, OBJECT, update the table that stores its instance data. DATABASE defaults to *DEFAULT-DATABASE* and specifies the database in which the update is made only if OBJECT is not associated with a database. In this case, a record is created in the appropriate table of DATABASE using values from the slot values of OBJECT, and OBJECT becomes associated with DATABASE.

UPDATE-SLOT-FROM-RECORD (OBJECT SLOT &KEY DATABASE (DATABASE *DEFAULT-DATABASE*))

Updates the slot value, specified by the CLOS slot name SLOT, of the View Class instance OBJECT using the attribute values of the appropriate table of DATABASE which defaults to the database associated with OBJECT or, if OBJECT is not associated with a database, *DEFAULT-DATABASE*. Join slots are updated but instances of the class on which the join is made are not updated.

Undocumented

BAD-COMPONENT (CONDITION)

MIDNIGHT (SELF)

SQL-ERROR-CONNECTION-SPEC (CONDITION)

SQL-ERROR-DATABASE (CONDITION)

SQL-ERROR-DATABASE-MESSAGE (CONDITION)

SQL-ERROR-DATABASE-TYPE (CONDITION)

SQL-ERROR-ERROR-ID (CONDITION)

SQL-ERROR-EXPRESSION (CONDITION)

SQL-ERROR-SECONDARY-ERROR-ID (CONDITION)

SQL-USER-ERROR-MESSAGE (CONDITION)

SQL-WARNING-DATABASE (CONDITION)

SLOT-ACCESSOR

Public

VIEW-TABLE (OBJECT)

get the view-table of the view-class of o

Undocumented

DATABASE (OBJECT)

DATABASE-NAME (OBJECT)

DATABASE-TYPE (OBJECT)

SETFVIEW-TABLE (NEW-VALUE OBJECT)

VARIABLE

Public

*BACKEND-WARNING-BEHAVIOR*

Action to perform on warning messages from backend. Default is to :warn. May also be set to :error to signal an error or :ignore/nil to silently ignore the warning.

*CACHE-TABLE-QUERIES-DEFAULT*

Specifies the default behaivour for caching of attribute types. Meaningful values are t, nil and :flush as described for the action argument to CACHE-TABLE-QUERIES.

*CONNECT-IF-EXISTS*

Default value for the if-exists keyword argument in calls to CONNECT. Meaningful values are :new, :warn-new, :error, :warn-old and :old.

*DB-AUTO-SYNC*

A non-nil value means that creating View Class instances or setting their slots automatically creates/updates the corresponding records in the underlying database.

*DEFAULT-CACHING*

Controls whether SELECT caches objects by default. The CommonSQL specification states caching is on by default.

*DEFAULT-DATABASE*

Specifies the default database to be used.

*DEFAULT-DATABASE-TYPE*

Designates the default database type which is initialised by the function INITIALISE-DATABASE-TYPE.

*DEFAULT-STRING-LENGTH*

The length of a string which does not have a user-specified length.

*DEFAULT-UPDATE-OBJECTS-MAX-LEN*

The default value to use for the MAX-LEN keyword argument to UPDATE-OBJECT-JOINS.

*FOREIGN-LIBRARY-SEARCH-PATHS*

A list of pathnames denoting directories where CLSQL will look for foreign libraries (in addition to the default places).

*INITIALIZED-DATABASE-TYPES*

A list of database types which have currently been initialised by calling INITIALIZE-DATABASE-TYPE.

*OLD-SEQUENCE-NAMES*

Should CLSQL use its old sequence naming scheme _CLSQL_SEQ_{table} instead of the current scheme {table}_CLSQL_SEQ

CLASS

Public

DATABASE (OBJECT)

This class is the supertype of all databases handled by CLSQL.

SQL (&REST ARGS)

A literal SQL expression.

SQL-QUERY (&REST ARGS)

An SQL SELECT query.

STANDARD-DB-OBJECT

Superclass for all CLSQL View Classes.

Undocumented

DATE

DURATION

SQL-OBJECT-QUERY

WALL-TIME

CONDITION

Public

SQL-CONNECTION-ERROR

Used to signal an error in connecting to a database.

SQL-DATABASE-DATA-ERROR

Used to signal an error with the SQL data passed to a database.

SQL-DATABASE-ERROR

Used to signal an error in a CLSQL database interface.

SQL-FATAL-ERROR

Used to signal an error when the database connection is no longer usable.

SQL-TEMPORARY-ERROR

Used to signal an error when the database cannot currently process a valid interaction because, for example, it is still executing another command possibly issued by another user.

SQL-TIMEOUT-ERROR

Used to signal an error when the database times out while processing some operation.

SQL-USER-ERROR

Used to signal lisp errors inside CLSQL.

Undocumented

SQL-CONDITION

SQL-DATABASE-WARNING

SQL-ERROR

SQL-WARNING