The mssql Reference Manual

This is the mssql Reference Manual, version 0.0.3, generated automatically by Declt version 4.0 beta 2 "William Riker" on Wed May 15 04:16:34 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 mssql

A Common Lisp library for interacting with MS SQL Server databases.

Author

Andrey Moskvitin <>

Home Page

https://github.com/archimag/cl-mssql

License

GPLv2

Version

0.0.3

Dependencies
  • cffi (system).
  • iterate (system).
  • garbage-pools (system).
  • parse-number (system).
Source

mssql.asd.

Child Component

src (module).


3 Modules

Modules are listed depth-first from the system components tree.


3.1 mssql/src

Source

mssql.asd.

Parent Component

mssql (system).

Child Components

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


4.1 Lisp


4.1.1 mssql/mssql.asd

Source

mssql.asd.

Parent Component

mssql (system).

ASDF Systems

mssql.


4.1.2 mssql/src/packages.lisp

Source

mssql.asd.

Parent Component

src (module).

Packages

mssql.


4.1.3 mssql/src/mssql.lisp

Dependency

packages.lisp (file).

Source

mssql.asd.

Parent Component

src (module).

Public Interface

print-object (method).

Internals

4.1.4 mssql/src/connection.lisp

Dependency

mssql.lisp (file).

Source

mssql.asd.

Parent Component

src (module).

Public Interface
Internals

4.1.5 mssql/src/query.lisp

Dependency

connection.lisp (file).

Source

mssql.asd.

Parent Component

src (module).

Public Interface

query (function).

Internals

4.1.6 mssql/src/execute.lisp

Dependency

connection.lisp (file).

Source

mssql.asd.

Parent Component

src (module).

Public Interface
Internals

4.1.7 mssql/src/remote.lisp

Dependency

query.lisp (file).

Source

mssql.asd.

Parent Component

src (module).

Public Interface

call-remote-procedure (function).

Internals

5 Packages

Packages are listed by definition order.


5.1 mssql

Source

packages.lisp.

Use List
  • cffi.
  • common-lisp.
  • iterate.
Public Interface
Internals

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


6.1 Public Interface


6.1.1 Special variables

Special Variable: *database*
Package

mssql.

Source

connection.lisp.


6.1.2 Macros

Macro: with-connection ((database user password host &key external-format) &body body)

Connects to ‘database‘ on ‘host‘ using ‘user‘ and ‘password‘.
Inside of ‘body‘, the connection is bound to the special variable *database*

Package

mssql.

Source

connection.lisp.

Macro: with-transaction ((&key connection name) &body body)

Execute the body within a database transaction, committing when the body exits normally, and aborting otherwise. An optional name can be given to the transaction, which can be used to force a commit or abort before the body unwinds.

Package

mssql.

Source

execute.lisp.


6.1.3 Ordinary functions

Function: call-remote-procedure (name &rest params)
Package

mssql.

Source

remote.lisp.

Function: commit-transaction (transaction)

Immediately commit an open transaction.

Package

mssql.

Source

execute.lisp.

Function: connect (database user password host &key external-format)

Connects to ‘database‘ on ‘host‘ using ‘user‘ and ‘password‘. The external format defaults to :utf-8.

A CLOS object of type ’database-connection is returned.

Package

mssql.

Source

connection.lisp.

Function: connect-toplevel (database user password host &key external-format)

Connects to ‘database‘ on ‘host‘ using ‘user‘ and ‘password‘. The connection is bound to the special variable *database*

Package

mssql.

Source

connection.lisp.

Function: connected-p (connection)

Is ‘connection‘ available?

Package

mssql.

Source

connection.lisp.

Function: disconnect (connection)

Disconnect from ‘connection‘.

Package

mssql.

Source

connection.lisp.

Function: disconnect-toplevel ()

Disconnects from *database*

Package

mssql.

Source

connection.lisp.

Function: execute (query &key connection)
Package

mssql.

Source

execute.lisp.

Function: query (query &key connection format)

Sends in ‘query‘ to ‘connection‘, return the result as ‘format‘. Format can be any keyword found in *query-formats*.

Package

mssql.

Source

query.lisp.

Function: rollback-transaction (transaction)

Immediately rollback an open transaction.

Package

mssql.

Source

execute.lisp.


6.1.4 Standalone methods

Method: object-register ((object database-connection) &optional pool)
Package

garbage-pools.

Source

connection.lisp.

Method: print-object ((err mssql-error) stream)
Source

mssql.lisp.


6.1.5 Classes

Class: database-connection
Package

mssql.

Source

connection.lisp.

Direct methods

object-register.

Direct slots
Slot: dbproc
Initargs

:dbproc

Slot: external-format
Initform

:utf-8

Initargs

:external-format


6.2 Internals


6.2.1 Constants

Constant: +fail+
Package

mssql.

Source

mssql.lisp.

Constant: +int_cancel+
Package

mssql.

Source

mssql.lisp.

Constant: +no-more-results+
Package

mssql.

Source

query.lisp.

Constant: +no-more-rows+
Package

mssql.

Source

query.lisp.

Constant: +numeric-buf-sz+
Package

mssql.

Source

query.lisp.


6.2.2 Special variables

Special Variable: *error-message-list*
Package

mssql.

Source

mssql.lisp.

Special Variable: *query-formats*

Formats available for returning from QUERY.

Package

mssql.

Source

query.lisp.


6.2.3 Macros

Macro: define-row-reader (name (collumn value) &body body)
Package

mssql.

Source

query.lisp.

Macro: define-sybdb-function ((foreign-name lisp-name &optional check-mode error-message) return-type &body args)
Package

mssql.

Source

mssql.lisp.


6.2.4 Ordinary functions

Function: %%dbcancel (dbproc)
Package

mssql.

Source

connection.lisp.

Function: %%dbcmd (dbproc cmdstring)
Package

mssql.

Source

connection.lisp.

Function: %%dblogin ()
Package

mssql.

Source

connection.lisp.

Function: %%dbsetlname (login value which)
Package

mssql.

Source

connection.lisp.

Function: %%dbsqlexec (dbproc)
Package

mssql.

Source

connection.lisp.

Function: %%tdsdbopen (login server msdblib)
Package

mssql.

Source

connection.lisp.

Function: %dbcancel (dbproc)
Package

mssql.

Source

connection.lisp.

Function: %dbclose (dbproc)
Package

mssql.

Source

connection.lisp.

Function: %dbcmd (dbproc cmdstring)
Package

mssql.

Source

connection.lisp.

Function: %dbcolname (dbproc colnum)
Package

mssql.

Source

query.lisp.

Function: %dbcoltype (dbproc colnum)
Package

mssql.

Source

query.lisp.

Function: %dbconvert (dbproc srctype src srclen desttype dest destlen)
Package

mssql.

Source

query.lisp.

Function: %dbdata (dbproc column)
Package

mssql.

Source

query.lisp.

Function: %dbdatlen (dbproc column)
Package

mssql.

Source

query.lisp.

Function: %dberrhandle (handler)
Package

mssql.

Source

mssql.lisp.

Function: %dblogin ()
Package

mssql.

Source

connection.lisp.

Function: %dbloginfree (login)
Package

mssql.

Source

connection.lisp.

Function: %dbmsghandle (handler)
Package

mssql.

Source

mssql.lisp.

Function: %dbnextrow (dbproc)
Package

mssql.

Source

query.lisp.

Function: %dbnumcols (dbproc)
Package

mssql.

Source

query.lisp.

Function: %dbresults (dbproc)
Package

mssql.

Source

query.lisp.

Function: %dbrpcinit (dbproc rpcname options)
Package

mssql.

Source

remote.lisp.

Function: %dbrpcparam (dbproc paramname status type maxlen datalen value)
Package

mssql.

Source

remote.lisp.

Function: %dbrpcsend (dbproc)
Package

mssql.

Source

remote.lisp.

Function: %dbsetlname (login value which)
Package

mssql.

Source

connection.lisp.

Function: %dbsqlexec (dbproc)
Package

mssql.

Source

connection.lisp.

Function: %tdsdbopen (login server msdblib)
Package

mssql.

Source

connection.lisp.

Function: all-rows (%dbproc collumns get-row-fun)
Package

mssql.

Source

query.lisp.

Function: cffi-string (str &optional pool)
Package

mssql.

Source

mssql.lisp.

Function: field-name-s (str)
Package

mssql.

Source

query.lisp.

Function: get-results (%dbproc format)
Package

mssql.

Source

query.lisp.

Function: lisp-to-sysdb (val)
Package

mssql.

Source

remote.lisp.

Function: one-row (%dbproc collumns get-row-fun)
Package

mssql.

Source

query.lisp.

Function: read-alist-row (g0 g1)
Package

mssql.

Source

query.lisp.

Function: read-list-row (g0 g1)
Package

mssql.

Source

query.lisp.

Function: read-plist-row (g0 g1)
Package

mssql.

Source

query.lisp.

Function: read-single-value (%dbproc collumns)
Package

mssql.

Source

query.lisp.

Function: sysdb-data-to-lisp (%dbproc data type len)
Package

mssql.

Source

query.lisp.

Function: unsigned-to-signed (byte n)
Package

mssql.

Source

query.lisp.


6.2.5 Generic functions

Generic Reader: transaction-connection (object)
Package

mssql.

Methods
Reader Method: transaction-connection ((transaction-handle transaction-handle))

automatically generated reader method

Source

execute.lisp.

Target Slot

connection.

Generic Reader: transaction-open-p (object)
Package

mssql.

Methods
Reader Method: transaction-open-p ((transaction-handle transaction-handle))

automatically generated reader method

Source

execute.lisp.

Target Slot

open-p.

Generic Writer: (setf transaction-open-p) (object)
Package

mssql.

Methods
Writer Method: (setf transaction-open-p) ((transaction-handle transaction-handle))

automatically generated writer method

Source

execute.lisp.

Target Slot

open-p.


6.2.6 Conditions

Condition: mssql-error
Package

mssql.

Source

mssql.lisp.

Direct superclasses

error.

Direct methods

print-object.

Direct slots
Slot: messages
Initform

(quote nil)

Initargs

:messages


6.2.7 Classes

Class: transaction-handle

Simple box type for storing the status and the
associated database connection of a transaction. When open-p is nil, the transaction has been aborted or committed.

Package

mssql.

Source

execute.lisp.

Direct methods
Direct slots
Slot: open-p
Initform

t

Readers

transaction-open-p.

Writers

(setf transaction-open-p).

Slot: connection
Initargs

:connection

Readers

transaction-connection.

Writers

This slot is read-only.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   %   (  
A   C   D   E   F   G   L   M   O   P   Q   R   S   T   U   W  
Index Entry  Section

%
%%dbcancel: Private ordinary functions
%%dbcmd: Private ordinary functions
%%dblogin: Private ordinary functions
%%dbsetlname: Private ordinary functions
%%dbsqlexec: Private ordinary functions
%%tdsdbopen: Private ordinary functions
%dbcancel: Private ordinary functions
%dbclose: Private ordinary functions
%dbcmd: Private ordinary functions
%dbcolname: Private ordinary functions
%dbcoltype: Private ordinary functions
%dbconvert: Private ordinary functions
%dbdata: Private ordinary functions
%dbdatlen: Private ordinary functions
%dberrhandle: Private ordinary functions
%dblogin: Private ordinary functions
%dbloginfree: Private ordinary functions
%dbmsghandle: Private ordinary functions
%dbnextrow: Private ordinary functions
%dbnumcols: Private ordinary functions
%dbresults: Private ordinary functions
%dbrpcinit: Private ordinary functions
%dbrpcparam: Private ordinary functions
%dbrpcsend: Private ordinary functions
%dbsetlname: Private ordinary functions
%dbsqlexec: Private ordinary functions
%tdsdbopen: Private ordinary functions

(
(setf transaction-open-p): Private generic functions
(setf transaction-open-p): Private generic functions

A
all-rows: Private ordinary functions

C
call-remote-procedure: Public ordinary functions
cffi-string: Private ordinary functions
commit-transaction: Public ordinary functions
connect: Public ordinary functions
connect-toplevel: Public ordinary functions
connected-p: Public ordinary functions

D
define-row-reader: Private macros
define-sybdb-function: Private macros
disconnect: Public ordinary functions
disconnect-toplevel: Public ordinary functions

E
execute: Public ordinary functions

F
field-name-s: Private ordinary functions
Function, %%dbcancel: Private ordinary functions
Function, %%dbcmd: Private ordinary functions
Function, %%dblogin: Private ordinary functions
Function, %%dbsetlname: Private ordinary functions
Function, %%dbsqlexec: Private ordinary functions
Function, %%tdsdbopen: Private ordinary functions
Function, %dbcancel: Private ordinary functions
Function, %dbclose: Private ordinary functions
Function, %dbcmd: Private ordinary functions
Function, %dbcolname: Private ordinary functions
Function, %dbcoltype: Private ordinary functions
Function, %dbconvert: Private ordinary functions
Function, %dbdata: Private ordinary functions
Function, %dbdatlen: Private ordinary functions
Function, %dberrhandle: Private ordinary functions
Function, %dblogin: Private ordinary functions
Function, %dbloginfree: Private ordinary functions
Function, %dbmsghandle: Private ordinary functions
Function, %dbnextrow: Private ordinary functions
Function, %dbnumcols: Private ordinary functions
Function, %dbresults: Private ordinary functions
Function, %dbrpcinit: Private ordinary functions
Function, %dbrpcparam: Private ordinary functions
Function, %dbrpcsend: Private ordinary functions
Function, %dbsetlname: Private ordinary functions
Function, %dbsqlexec: Private ordinary functions
Function, %tdsdbopen: Private ordinary functions
Function, all-rows: Private ordinary functions
Function, call-remote-procedure: Public ordinary functions
Function, cffi-string: Private ordinary functions
Function, commit-transaction: Public ordinary functions
Function, connect: Public ordinary functions
Function, connect-toplevel: Public ordinary functions
Function, connected-p: Public ordinary functions
Function, disconnect: Public ordinary functions
Function, disconnect-toplevel: Public ordinary functions
Function, execute: Public ordinary functions
Function, field-name-s: Private ordinary functions
Function, get-results: Private ordinary functions
Function, lisp-to-sysdb: Private ordinary functions
Function, one-row: Private ordinary functions
Function, query: Public ordinary functions
Function, read-alist-row: Private ordinary functions
Function, read-list-row: Private ordinary functions
Function, read-plist-row: Private ordinary functions
Function, read-single-value: Private ordinary functions
Function, rollback-transaction: Public ordinary functions
Function, sysdb-data-to-lisp: Private ordinary functions
Function, unsigned-to-signed: Private ordinary functions

G
Generic Function, (setf transaction-open-p): Private generic functions
Generic Function, transaction-connection: Private generic functions
Generic Function, transaction-open-p: Private generic functions
get-results: Private ordinary functions

L
lisp-to-sysdb: Private ordinary functions

M
Macro, define-row-reader: Private macros
Macro, define-sybdb-function: Private macros
Macro, with-connection: Public macros
Macro, with-transaction: Public macros
Method, (setf transaction-open-p): Private generic functions
Method, object-register: Public standalone methods
Method, print-object: Public standalone methods
Method, transaction-connection: Private generic functions
Method, transaction-open-p: Private generic functions

O
object-register: Public standalone methods
one-row: Private ordinary functions

P
print-object: Public standalone methods

Q
query: Public ordinary functions

R
read-alist-row: Private ordinary functions
read-list-row: Private ordinary functions
read-plist-row: Private ordinary functions
read-single-value: Private ordinary functions
rollback-transaction: Public ordinary functions

S
sysdb-data-to-lisp: Private ordinary functions

T
transaction-connection: Private generic functions
transaction-connection: Private generic functions
transaction-open-p: Private generic functions
transaction-open-p: Private generic functions

U
unsigned-to-signed: Private ordinary functions

W
with-connection: Public macros
with-transaction: Public macros