Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the qmynd Reference Manual, version 1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 05:39:45 2022 GMT+0.
Next: Systems, Previous: The qmynd Reference Manual, Up: The qmynd Reference Manual [Contents][Index]
A MySQL client that uses the native network protocol to communicate with a MySQL server.
Like many libraries in Common Lisp, QMyND
is available
in Quicklisp. To load the driver
type (ql:quickload 'qmynd)
in the REPL.
QMyND
is rather undocumented. The best resources for learning how it
works are its source code and the included tests.
There are two ways to connect to a MySQL database: the network socket and
the local socket. The second type of connection is possible only in case
of implementations supporting AF_LOCAL
sockets (at the time of
writing: CCL, ECL and SBCL) with the function mysql-local-connect
. In
our example we will use the first type, but the usage is very much similar
in both cases.
All communication with the database is done through an opaque structure representing connection. The following invocation is self-explanatory:
> (defparameter *connection*
(qmynd:mysql-connect
:host "localhost" :username "jack" :password "daniel" :database "mydb"))
*CONNECTION*
Driver supports both queries and prepared statements. To issue a simple
query we use the mysql-query
function:
> (qmynd:mysql-query
*connection*
"CREATE TABLE super_table (id INT, name VARCHAR(255), timestamp DATETIME)")
#S(QMYND:RESPONSE-OK-PACKET
:AFFECTED-ROWS 0
:LAST-INSERT-ID 0
:STATUS-FLAGS 2
:WARNINGS 0
:INFO "")
> (qmynd:response-ok-packet-status-flags *)
2
If the query doesn't return rows, the function returns the
response-ok-packet
structure that may be read with standard
accessors, which were automatically created for the structure as
depicted in the snippet above.
For efficiency and security the user may use a prepared statement. First we need to prepare it.
> (defparameter *st-insert*
(qmynd:mysql-statement-prepare
*connection*
"INSERT INTO super_table VALUES (?, ?, NOW())"))
*ST-INSERT*
Parameters to the statement are passed with the key argument parameters
,
which needs to be a sequence (be it a vector or a list):
> (qmynd:mysql-statement-execute *st-insert* :parameters #(1 "foo"))
#S(QMYND:RESPONSE-OK-PACKET
:AFFECTED-ROWS 1
:LAST-INSERT-ID 0
:STATUS-FLAGS 2
:WARNINGS 0
:INFO "")
> (dotimes (v 10)
(qmynd:mysql-statement-execute *st-insert* :parameters (vector v "foo"))
(sleep 1))
NIL
When we are done with the statement we should close it to release the server-side resources:
(qmynd:mysql-statement-close *st-insert*)
; no value
When we query database for rows, we receive two values: the resulting rows
sequence (try the key parameter result-type
to customize its type) and a
vector of column descriptors. The second value is not very interesting to
us because it is part of the internal implementation.
> (let ((results (qmynd:mysql-query
*connection*
"SELECT * FROM super_table LIMIT 3"
:result-type 'list)))
results)
((1 "foo" #<MYSQL-DATE-TIME 2017-08-30 14:47:07.000000>)
(0 "foo" #<MYSQL-DATE-TIME 2017-08-30 14:49:17.000000>)
(1 "foo" #<MYSQL-DATE-TIME 2017-08-30 14:49:18.000000>))
To process rows one-by-one with a function and discard them without
consing the result, the key parameter row-fn
should be used. To coerce
all columns to text, set as-text
to T
:
> (qmynd:mysql-query
*connection*
"SELECT * FROM super_table LIMIT 3"
:as-text t
:row-fn (lambda (row) (print row))
:result-type 'list)
("1" "foo" "2017-08-30 14:47:07")
("0" "foo" "2017-08-30 14:49:17")
("1" "foo" "2017-08-30 14:49:18")
NIL
Note that only the returned value above is NIL; the preceding lists are printed statements appearing in the console.
MySQL date
and interval
types are represented as CLOS objects on
which some methods are defined.
> (qmynd:universal-time-to-mysql-date-time (get-universal-time))
#<MYSQL-DATE-TIME 2017-08-30 13:24:26.000000>
> (qmynd:mysql-date-time-year *)
2017
> (qmynd:seconds-to-mysql-time-interval 100)
#<MYSQL-TIME-INTERVAL 0:01:40.000000>
> (cons (qmynd:mysql-time-interval-seconds *)
(qmynd:mysql-time-interval-minutes *))
(40 . 1)
When we are done with working on our database, we may close the connection:
> (qmynd:mysql-disconnect *connection*)
NIL
This short tutorial is meant to get your feet wet with using MySQL. For more sophisticated usage you should read the source code and docstrings.
This is a free software published under an MIT-like license (see
LICENSE
). The project is hosted on GitHub and is developed by
individuals scattered around the world like many other FOSS projects.
To contribute you have to fork the repository located
at https://github.com/qitab/qmynd
and issue a pull request with your commits. Ideas for improvements
may be found in a TODO
file and issue entries on tracker hosted
with the project. Writing documentation and tests is also a useful
task which benefits the project's usefulness and stability.
Next: Modules, Previous: Introduction, Up: The qmynd Reference Manual [Contents][Index]
The main system appears first, followed by any subsystem dependency.
MySQL Native Driver
Alejandro Sedeño
Alejandro Sedeño
MIT-style
MySQL Native Driver for Common Lisp
1.0
src (module).
Next: Files, Previous: Systems, Up: The qmynd Reference Manual [Contents][Index]
Modules are listed depth-first from the system components tree.
Next: qmynd/src/common, Previous: Modules, Up: Modules [Contents][Index]
qmynd (system).
Next: qmynd/src/wire-protocol, Previous: qmynd/src, Up: Modules [Contents][Index]
pkgdcl.lisp (file).
src (module).
Next: qmynd/src/mysql-protocol, Previous: qmynd/src/common, Up: Modules [Contents][Index]
common (module).
src (module).
Next: qmynd/src/mysql-protocol/text-protocol, Previous: qmynd/src/wire-protocol, Up: Modules [Contents][Index]
src (module).
Next: qmynd/src/mysql-protocol/prepared-statements, Previous: qmynd/src/mysql-protocol, Up: Modules [Contents][Index]
mysql-protocol (module).
Previous: qmynd/src/mysql-protocol/text-protocol, Up: Modules [Contents][Index]
mysql-protocol (module).
Next: Packages, Previous: Modules, Up: The qmynd Reference Manual [Contents][Index]
Files are sorted by type and then listed depth-first from the systems components trees.
Next: qmynd/src/common/charsets.lisp, Previous: qmynd/qmynd.asd, Up: Lisp [Contents][Index]
src (module).
Next: qmynd/src/common/constants.lisp, Previous: qmynd/src/pkgdcl.lisp, Up: Lisp [Contents][Index]
common (module).
Next: qmynd/src/common/conditions.lisp, Previous: qmynd/src/common/charsets.lisp, Up: Lisp [Contents][Index]
charsets.lisp (file).
common (module).
Next: qmynd/src/common/feature-detection.lisp, Previous: qmynd/src/common/constants.lisp, Up: Lisp [Contents][Index]
common (module).
Next: qmynd/src/common/utilities.lisp, Previous: qmynd/src/common/conditions.lisp, Up: Lisp [Contents][Index]
common (module).
Next: qmynd/src/common/date-time.lisp, Previous: qmynd/src/common/feature-detection.lisp, Up: Lisp [Contents][Index]
common (module).
Next: qmynd/src/common/misc.lisp, Previous: qmynd/src/common/utilities.lisp, Up: Lisp [Contents][Index]
common (module).
Next: qmynd/src/wire-protocol/wire-packet.lisp, Previous: qmynd/src/common/date-time.lisp, Up: Lisp [Contents][Index]
constants.lisp (file).
common (module).
mysql-cs-coll-to-character-encoding (function).
Next: qmynd/src/wire-protocol/basic-types.lisp, Previous: qmynd/src/common/misc.lisp, Up: Lisp [Contents][Index]
wire-protocol (module).
print-object (method).
Next: qmynd/src/wire-protocol/compressed-protocol.lisp, Previous: qmynd/src/wire-protocol/wire-packet.lisp, Up: Lisp [Contents][Index]
wire-packet.lisp (file).
wire-protocol (module).
Next: qmynd/src/mysql-protocol/define-packet.lisp, Previous: qmynd/src/wire-protocol/basic-types.lisp, Up: Lisp [Contents][Index]
basic-types.lisp (file).
wire-protocol (module).
Next: qmynd/src/mysql-protocol/connection.lisp, Previous: qmynd/src/wire-protocol/compressed-protocol.lisp, Up: Lisp [Contents][Index]
mysql-protocol (module).
packet-slot-name (reader method).
Next: qmynd/src/mysql-protocol/response-packets.lisp, Previous: qmynd/src/mysql-protocol/define-packet.lisp, Up: Lisp [Contents][Index]
mysql-protocol (module).
Next: qmynd/src/mysql-protocol/authentication.lisp, Previous: qmynd/src/mysql-protocol/connection.lisp, Up: Lisp [Contents][Index]
mysql-protocol (module).
Next: qmynd/src/mysql-protocol/handshake.lisp, Previous: qmynd/src/mysql-protocol/response-packets.lisp, Up: Lisp [Contents][Index]
mysql-protocol (module).
Next: qmynd/src/mysql-protocol/response-result-set.lisp, Previous: qmynd/src/mysql-protocol/authentication.lisp, Up: Lisp [Contents][Index]
mysql-protocol (module).
Next: qmynd/src/mysql-protocol/text-protocol/command-quit.lisp, Previous: qmynd/src/mysql-protocol/handshake.lisp, Up: Lisp [Contents][Index]
define-packet.lisp (file).
mysql-protocol (module).
Next: qmynd/src/mysql-protocol/text-protocol/command-initialize-database.lisp, Previous: qmynd/src/mysql-protocol/response-result-set.lisp, Up: Lisp [Contents][Index]
text-protocol (module).
send-command-quit (function).
Next: qmynd/src/mysql-protocol/text-protocol/command-query.lisp, Previous: qmynd/src/mysql-protocol/text-protocol/command-quit.lisp, Up: Lisp [Contents][Index]
text-protocol (module).
send-command-initialize-database (function).
Next: qmynd/src/mysql-protocol/text-protocol/command-field-list.lisp, Previous: qmynd/src/mysql-protocol/text-protocol/command-initialize-database.lisp, Up: Lisp [Contents][Index]
text-protocol (module).
send-command-query (function).
Next: qmynd/src/mysql-protocol/text-protocol/command-refresh.lisp, Previous: qmynd/src/mysql-protocol/text-protocol/command-query.lisp, Up: Lisp [Contents][Index]
text-protocol (module).
send-command-field-list (function).
Next: qmynd/src/mysql-protocol/text-protocol/command-shutdown.lisp, Previous: qmynd/src/mysql-protocol/text-protocol/command-field-list.lisp, Up: Lisp [Contents][Index]
text-protocol (module).
send-command-refresh (function).
Next: qmynd/src/mysql-protocol/text-protocol/command-statistics.lisp, Previous: qmynd/src/mysql-protocol/text-protocol/command-refresh.lisp, Up: Lisp [Contents][Index]
text-protocol (module).
send-command-shutdown (function).
Next: qmynd/src/mysql-protocol/text-protocol/command-process-information.lisp, Previous: qmynd/src/mysql-protocol/text-protocol/command-shutdown.lisp, Up: Lisp [Contents][Index]
text-protocol (module).
send-command-statistics (function).
Next: qmynd/src/mysql-protocol/text-protocol/command-process-kill.lisp, Previous: qmynd/src/mysql-protocol/text-protocol/command-statistics.lisp, Up: Lisp [Contents][Index]
text-protocol (module).
send-command-process-information (function).
Next: qmynd/src/mysql-protocol/text-protocol/command-debug.lisp, Previous: qmynd/src/mysql-protocol/text-protocol/command-process-information.lisp, Up: Lisp [Contents][Index]
text-protocol (module).
send-command-process-kill (function).
Next: qmynd/src/mysql-protocol/text-protocol/command-ping.lisp, Previous: qmynd/src/mysql-protocol/text-protocol/command-process-kill.lisp, Up: Lisp [Contents][Index]
text-protocol (module).
send-command-debug (function).
Next: qmynd/src/mysql-protocol/text-protocol/command-change-user.lisp, Previous: qmynd/src/mysql-protocol/text-protocol/command-debug.lisp, Up: Lisp [Contents][Index]
text-protocol (module).
send-command-ping (function).
Next: qmynd/src/mysql-protocol/prepared-statements/binary-protocol-encoding.lisp, Previous: qmynd/src/mysql-protocol/text-protocol/command-ping.lisp, Up: Lisp [Contents][Index]
text-protocol (module).
send-command-change-user (function).
Next: qmynd/src/mysql-protocol/prepared-statements/prepared-statement.lisp, Previous: qmynd/src/mysql-protocol/text-protocol/command-change-user.lisp, Up: Lisp [Contents][Index]
prepared-statements (module).
encode-binary-parameter (function).
Next: qmynd/src/api.lisp, Previous: qmynd/src/mysql-protocol/prepared-statements/binary-protocol-encoding.lisp, Up: Lisp [Contents][Index]
binary-protocol-encoding.lisp (file).
prepared-statements (module).
Previous: qmynd/src/mysql-protocol/prepared-statements/prepared-statement.lisp, Up: Lisp [Contents][Index]
mysql-protocol (module).
src (module).
Next: Definitions, Previous: Files, Up: The qmynd Reference Manual [Contents][Index]
Packages are listed by definition order.
Previous: qmynd-impl, Up: Packages [Contents][Index]
Next: Indexes, Previous: Packages, Up: The qmynd Reference Manual [Contents][Index]
Definitions are sorted by export status, category, package, and then by lexicographic order.
Next: Internals, Previous: Definitions, Up: Definitions [Contents][Index]
Next: Special variables, Previous: Public Interface, Up: Public Interface [Contents][Index]
Next: Macros, Previous: Constants, Up: Public Interface [Contents][Index]
All API entry-points after connect take a mysql-connection argument and must bind *mysql-connection* to that connection for internal function use.
As it happens, it’s quite easy to have data in an encoding known only by the application, and completely unknown by MySQL which will keep sending unrelated meta-data. Use this setting to force the Qmynd driver to be using the encoding you know your data is encoded with.
Next: Ordinary functions, Previous: Special variables, Up: Public Interface [Contents][Index]
Next: Generic functions, Previous: Macros, Up: Public Interface [Contents][Index]
This function implements the MySQL clear-text password authentication mechanism.
Initialize the default MySQL connection for a new command. Resets sequence-id in underlying stream(s).
Connect to a MySQL over a network (AF_INET) socket and begin the MySQL Handshake.
Returns a QMYND:MYSQL-CONNECTION object or signals a QMYND:MYSQL-ERROR.
Accepts the following keyword arguments:
HOST: The host to connect to. (default: "localhost")
PORT: The port to connect to. (default: 3306)
USERNAME: User to authenticate as.
PASSWORD: Password to authenticate with.
DATABASE: What database to use upon connecting. (default: nil)
CLIENT-FOUND-ROWS: Whether or not to require the client-found-rows feature from the server (default: nil)
COMPRESS: Whether or not to use compression. (default: nil).
SSL: Whether or not to use SSL. (default: :UNSPECIFIED)
T - Forces SSL (or error out if it’s not available).
NIL - Disable SSL, even if it is available.
:UNSPECIFIED - Opportunistic use of SSL.
SSL-VERIFY: Whether or not to verify the SSL certificate presented by the server. (Default: nil)
Tests to see if COMMAND is the current command of the default MySQL connection.
Converts a MySQL DateTime to a Lisp integer-time. Returns NIL if all elements of the date-time are zero.
Connect to a MySQL over a local (AF_LOCAL) socket and begin the MySQL Handshake.
Returns a QMYND:MYSQL-CONNECTION object or signals a QMYND:MYSQL-ERROR.
Accepts the following keyword arguments:
PATH: The path of the local socket to connect to. (default: #P"/var/run/mysqld/mysqld.sock")
USERNAME: User to authenticate as.
PASSWORD: Password to authenticate with.
DATABASE: What database to use upon connecting. (default: nil)
CLIENT-FOUND-ROWS: Whether or not to require the client-found-rows feature from the server (default: nil)
Send a SQL Query over the connection using the MySQL Text Protocol.
For queries that return rows, returns two values:
A vector of rows, each of which is a vector of columns.
A vector of column descriptors.
For queries that don’t return rows, returns a QMYND:RESPONSE-OK-PACKET.
May signal a QMYND:MYSQL-ERROR.
Read a wire packet from the default MySQL connection’s stream.
Prepares a SQL Query using the MySQL Prepared Statement Protocol.
Returns a QMYND:MYSQL-PREPARED-STATEMENT.
NB: The QMYND:MYSQL-PREPARED-STATEMENT remembers the
QMYND:MYSQL-CONNECTION it was prepared for.
Converts a MYSQL-TIME-INTERVAL to a whole number of seconds. Returns microseconds as a second value.
Write PAYLOAD to the default MySQL connection’s stream as a wire packet.
Parse a generic (OK, ERR, EOF) packet.
Update MySQL connection status flags as necessary.
Accumulate the whole result set in memory then return it as a list or a vector depending on the value of RESULT-TYPE (a symbol).
Initial handshake processing dispatch.
Parse an INITIAL-HANDSHAKE-V10 Packet and populate the default MySQL connection.
Creates a MYSQL-TIME-INTERVAL representing VALUE seconds.
An optional second argument can be used to specify microseconds.
Send QUERY-STRING to the current MySQL connection.
When the ROW-FN parameter is given, it must be a function and is called
with each row as input, and the rows are discarded once the function is
called.
When AS-TEXT is t, the column values are not converted to native types
and returned as text instead.
By default the resultset is a vector of rows where each row is itself a vector of columns. When RESULT-TYPE is list, the result is a list of list of columns instead.
Send a MySQL Handshake Response v41 to the default MySQL connection.
Converts a Lisp integer-time to a MySQL DateTime. If integer-time is NIL, returns a MySQL DateTime with all elements set to zero.
Next: Standalone methods, Previous: Ordinary functions, Up: Public Interface [Contents][Index]
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
Read a wire packet from C’s stream.
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated reader method
automatically generated writer method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
Write PAYLOAD to C’s stream as a wire packet.
automatically generated reader method
day.
automatically generated writer method
day.
automatically generated reader method
hour.
automatically generated writer method
hour.
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
year.
automatically generated writer method
year.
Shut down a MySQL connection.
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
Deallocates and invalidates STATEMENT.
Executes a QMYND:MYSQL-PREPARED-STATEMENT.
Accepts the following keyword arguments:
PARAMETERS: a sequence of parameters for the placeholders in the prepared statement, if any.
automatically generated reader method
days.
automatically generated writer method
days.
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
year.
automatically generated writer method
year.
automatically generated reader method
bind.
automatically generated writer method
bind.
automatically generated reader method
eof.
automatically generated writer method
eof.
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
type.
automatically generated writer method
type.
automatically generated reader method
automatically generated writer method
Next: Conditions, Previous: Generic functions, Up: Public Interface [Contents][Index]
sb-gray.
sb-gray.
sb-gray.
trivial-gray-streams.
sb-gray.
trivial-gray-streams.
Next: Structures, Previous: Standalone methods, Up: Public Interface [Contents][Index]
Base class for all QMyND MySQL errors.
error.
Wraps errors returned in MySQL Error Packets.
Signaled when connecting to a server that does not meet the minimum requirements for the library.
qmynd-impl::server-flags
This slot is read-only.
Signaled when trying to authenticate to a server with an unsupported authentication plugin.
:plugin
This slot is read-only.
Signaled when the library didn’t get as many bytes as asked.
Signaled when SSL is requested but not supported.
Signaled when the library encounters an unexpected packet.
:payload
This slot is read-only.
Signaled when calling #’WRITE-DECIMAL-TO-STRING with a value that is not a decimal.
:value
Next: Classes, Previous: Conditions, Up: Public Interface [Contents][Index]
structure-object.
integer
integer
(or (integer 0 65535) null)
(or (integer 0 65535) null)
string
Previous: Structures, Up: Public Interface [Contents][Index]
The base class for all MySQL connections.
boolean
common-lisp.
:stream
(or string null)
(or integer null)
integer
(qmynd-impl::mysql-capabilities-supported)
keyword
:utf-8
integer
qmynd-impl::+mysql-cs-coll-utf8-general-ci+
(or integer null)
integer
0
(vector (unsigned-byte 8))
(or string null)
(or string null)
:default-schema
(or integer null)
list
(integer 0 65535)
0
:year
(integer 0 12)
0
:month
(integer 0 31)
0
:day
(integer 0 23)
0
:hour
(integer 0 59)
0
:minute
common-lisp.
(integer 0 59)
0
:second
(integer 0 999999)
0
:microsecond
(or qmynd:mysql-base-connection null)
:connection
string
:query-string
(unsigned-byte 32)
:statement-id
(list-of:vector-of qmynd-impl::column-definition-v41-packet)
:columns
(list-of:vector-of qmynd-impl::column-definition-v41-packet)
:parameters
boolean
:negativep
(integer 0 4294967295)
0
:days
(integer 0 23)
0
:hours
(integer 0 59)
0
:minutes
(integer 0 59)
0
:seconds
(integer 0 999999)
0
:microseconds
(integer 0 65535)
0
:year
symbol
:name
This slot is read-only.
boolean
t
:bind
keyword
:error
:eof
:predicate
common-lisp.
:reduce
:transform
boolean
:transient
:mysql-type
common-lisp.
:type
:value
Previous: Public Interface, Up: Definitions [Contents][Index]
Next: Special variables, Previous: Internals, Up: Internals [Contents][Index]
Larger packet that we may receive, see https://dev.mysql.com/doc/internals/en/sending-more-than-16mbyte.html
The minimum required capabilities for this client to interop with a MySQL server.
Client side implementation of max_allowed_packets.
Compiler optimization settings for safe, debuggable code.
Compiler optimization settings for fast, unsafe, hard-to-debug code.
Next: Compiler macros, Previous: Special variables, Up: Internals [Contents][Index]
Next: Ordinary functions, Previous: Macros, Up: Internals [Contents][Index]
Next: Generic functions, Previous: Compiler macros, Up: Internals [Contents][Index]
Helper function used in the definition of type DECIMAL-NUMBER.
Return T if the denominator of x has only 2 and/or 5 as factors, otherwise return NIL.
Internal for wire protocol use only.
tag.
name.
type.
Given a list of VECTORS containing LENGTH octets in total, return a single vector containing the same octets in the same order.
Returns a function that applies ’function’ to ’args’, plus any additional arguments given at the call site.
Decode the given vector of OCTETS into an internal Common Lisp string,
given a known encoding for it. Provide a couple of restarts in case the
decoding fails:
- use-nil decode octets as a nil value
- use-empty-string decode octets as an empty string ("")
- use-value decode octets as any given value.
Allocates a new input buffer stream from the results of parsing a new compressed packet off of the wrapped stream. Requires that the existing input buffer, if any, be empty.
Interns a new symbol in the current package.
Given a symbol designator ’x’, return a keyword whose name is ’x’. If ’x’ is nil, this returns nil.
Interns a new symbol in the keyword package.
Intern a string of the ’package:string’ and return the symbol.
Call the FN function with a single row from the result-set at a time.
When RESULT-TYPE is list, the row is a list, when RESULT-TYPE is vector, the row passed to the FN function is a vector.
Check if we are at the end of the packet, or if we need to read from the next chunk from the network within the same "logical" packet.
Returns the full set of capabilities supported by this client library.
Perform the MySQL Initial Handshake with CONNECTION.
Maps a MySQL Character Set / Collation identifier to an encoding.
Scramble password hash with first 8 bytes of auth-data.
tag.
Parses a date-time-string in one of the following forms and returns a MYSQL-DATE-TIME object.
"" – All fields = 0
"YYYY-MM-DD" – All time fields = 0
"YYYY-MM-DD hh:mm:ss" – Microseconds = 0
"YYYY-MM-DD hh:mm:ss.µµµµµµ"
Refrain from parsing data into lisp types, some application will only use the text form anyway
Parses the MySQL Text Protocol represetation of a time interval. /(-)?(h+):(mm):(ss).(µµµµµµ)/
Get the first octet in this stream’s chunk.
Prepare reading from a new packet from our source stream.
Read 1 octet from STREAM as an integer.
Read 2 octets from STREAM as an integer.
Read a compressed packet from STREAM.
Read an integer of LENGTH octets from STREAM.
Read LENGTH octets from STREAM, returns them in a vector.
NB: MySQL calls this a string, but we treat it as a vector of octets.
Read a MySQL Length-Encoded Integer from STREAM.
Accepts the following keyword arguments:
NULL-OK - Parse #xFB as NULL.
Signals an error when we fail to parse an integer.
Read a MySQL Length-Encoded Intgeer from STREAM, then read that many octets from STREAM.
Accepts the following keyword arguments:
NULL-OK: Allow READ-LENGTH-ENCODED-INTEGER to treat #xFB as NULL.
Read a single octet from STREAM.
Copy data from the STREAM into SEQUENCE.
Copy the rest of the whole data set into an array and return it.
Read LENGTH octets from STREAM and return an array of them.
Instanciate a my-packet-stream object and read some meta-data about it.
info.
Sends a MySQL SSL Connection Request Packet and begins SSL negotiation.
Write PAYLOAD to STREAM as one or more compressed packets.
Write INT to STREAM as a LENGTH byte integer.
Write INT to STREAM as a MySQL Length-Encoded Integer.
Assumes INT is non-negative.
Signals an error if INT is too big.
Write the length of OCTETS to STREAM as a MySQL Length-Encoded Integer, then write OCTETS to STREAM.
Write OCTETS to STREAM followed by a NUL octet. Assumes no NUL octet exist in OCTETS.
Write PAYLOAD to STREAM as one or more packets.
Next: Conditions, Previous: Ordinary functions, Up: Internals [Contents][Index]
text.
text.
The container for the incoming, just inflated, octet stream.
The container for the outgoing, to be deflated, octet stream.
Sequence IDs for the compressed protocol packet stream.
The underlying stream.
Close the MySQL connection’s socket.
Initialize connection for a new command. Resets sequence-id in underlying stream(s).
Removes from C all prepared statements that do not have C as their connection.
code.
automatically generated reader method
name.
Next: Structures, Previous: Generic functions, Up: Internals [Contents][Index]
Signaled when we encounter a bad type spec in DEFINE-PACKET.
:text
This slot is read-only.
Signaled when babel fails to decode OCTETS in ENCODING for a given column definition COLDEF.
:coldef
This slot is read-only.
:encoding
This slot is read-only.
:octets
This slot is read-only.
:error
This slot is read-only.
:text
This slot is read-only.
Signaled when trying to use an invalid MYSQL-PREPARED-STATEMENT.
Base class for all QMyND MySQL external (exported) errors.
Base class for all QMyND internal errors.
Signaled when the initial handshake returns an unknown protocol value.
:version
Signaled when the wrong number of parameters are passed while calling #’MYSQL-STATEMENT-EXECUTE.
Next: Classes, Previous: Conditions, Up: Internals [Contents][Index]
structure-object.
string
string
string
string
string
string
(integer 0 65535)
(integer 0 4294967295)
common-lisp.
(integer 0 255)
(integer 0 65535)
(integer 0 255)
(or string null)
structure-object.
(integer 0 4294967295)
(integer 0 65535)
(integer 0 65535)
(integer 0 65535)
structure-object.
string
(integer 0 4294967295)
(vector (unsigned-byte 8))
integer
(or (integer 0 255) null)
(or (integer 0 65535) null)
(or string null)
structure-object.
(or null stream)
(or null (simple-array (unsigned-byte 8) *))
(integer 0 255)
0
integer
0
integer
0
structure-object.
(integer 0 255)
Previous: Structures, Up: Internals [Contents][Index]
The underlying stream.
common-lisp.
:stream
The container for the incoming, just inflated, octet stream.
(or flexi-streams:in-memory-input-stream null)
The container for the outgoing, to be deflated, octet stream.
flexi-streams:in-memory-output-stream
(flexi-streams:make-in-memory-output-stream)
Sequence IDs for the compressed protocol packet stream.
integer
0
An AF_INET MySQL connections.
(or usocket:stream-usocket null)
:socket
An AF_LOCAL MySQL connection.
:socket
Previous: Definitions, Up: The qmynd Reference Manual [Contents][Index]
Jump to: | %
(
A B C D E F G H I K M O P R S U W |
---|