Changeset 7930 in project


Ignore:
Timestamp:
01/25/08 20:42:44 (12 years ago)
Author:
Kon Lovett
Message:

1.3 release. Moved aux C code into .scm file. Added mysql-options conn arg helper.

Location:
release/3/mysql
Files:
4 deleted
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • release/3/mysql/tags/1.3/eggdoc-mysql.scm

    r7925 r7930  
    8585
    8686      (subsection "Exceptions"
    87      
     87
    8888        (p
    8989          "Conditions of the kind " (code "(exn mysql)") " are signaled "
     
    103103            "Returns a MySQL connection object suitable for passing to "
    104104            "the other MySQL functions. This object is referred to as "
    105             (tt "DB") " when passed by all the other MySQL functions. "
     105            (tt "CONN") " when passed by all the other MySQL functions. "
    106106            "Signals an exception when the connection fails.")
    107107          (p
    108108            "Any number of the following " (tt "KEYWORDS") " may be included:"
    109109            (ul
    110               (li "host")
    111               (li "user")
    112               (li "passwd")
    113               (li "db")
    114               (li "port")
    115               (li "unix-socket")
    116               (li "client-flag")
    117               #;(li "ssl")
    118               #;(li "options")))
     110              (li (tt "host"))
     111              (li (tt "user"))
     112              (li (tt "passwd"))
     113              (li (tt "db"))
     114              (li (tt "port"))
     115              (li (tt "unix-socket"))
     116              (li (tt "client-flag"))
     117              (li (tt "ssl") " - A " (code "mysql-ssl") " record object.")
     118              (li (tt "options") " - An association list of " (code "(<mysql-option> . <object>) ".")))
    119119          (p
    120120            "Note that default values are available for all of these "
     
    123123            "for details on how these defaults are determined.)") )
    124124
    125         (procedure "(mysql-close DB)"
    126           (p
    127             "Closes the connection to " (tt "DB") ". This frees any remaining "
     125        (procedure "(mysql-connection? OBJECT)"
     126          (p
     127            "Is the " (tt "OBJECT") " a " (code "mysql-connection") " "
     128            "record? Referred to as a " (tt "CONN").") )
     129
     130        (procedure "(mysql-close CONN)"
     131          (p
     132            "Closes the connection to " (tt "CONN") ". This frees any remaining "
    128133            "MySQL resources from memory, but invalidates the MySQL connection "
    129             "object (" (tt "DB") ") so that it may no longer be used.") )
     134            "object (" (tt "CONN") ") so that it may no longer be used.") )
     135
     136        (subsubsection "Connect Parameter Constructors"
     137
     138          (procedure "(make-mysql-options OPTION-FLAG OPTION-VALUE ...)"
     139            (p
     140              "Returns an object suitable as the " (tt "options") " parameter for "
     141              (code "mysql-connect") ".")
     142            (p
     143              "The type of the " (tt "OPTION-VALUE") " is dependent on the "
     144              (tt "OPTION-FLAG") ".") )
     145
     146          (procedure "(make-mysql-ssl [KEYWORD ...])"
     147            (p
     148              "Returns a " (code "mysql-ssl") " record.")
     149            (p
     150              "Any number of the following " (tt "KEYWORD ...") " may be included:"
     151              (ul
     152                (li (tt "key") " - pathname of key file.")
     153                (li (tt "certificate") " - pathname of certificate file.")
     154                (li (tt "certificate-authority") " - pathname of certificate authority file.")
     155                (li (tt "trusted-certificates") " - pathname of trusted certificates directory.")
     156                (li (tt "ciphers")
     157                  " - See " (url "http://www.openssl.org/docs/apps/ciphers.html"
     158                                 "OpenSSL Ciphers Man Page")))) )
     159
     160          (procedure "(mysql-ssl? OBJECT)"
     161            (p
     162              "Is the " (tt "OBJECT") " an " (code "mysql-ssl") " record?") )
     163
     164          (procedure "(mysql-ssl-key-pathname MYSQL-SSL)"
     165            (p
     166              "Returns a " (code "string") ".") )
     167
     168          (procedure "(mysql-ssl-certificate-pathname MYSQL-SSL)"
     169            (p
     170              "Returns a " (code "string") ".") )
     171
     172          (procedure "(mysql-ssl-certificate-authority-pathname MYSQL-SSL)"
     173            (p
     174              "Returns a " (code "string") ".") )
     175
     176          (procedure "(mysql-ssl-trusted-certificates-pathname MYSQL-SSL)"
     177            (p
     178              "Returns a " (code "string") ".") )
     179
     180          (procedure "(mysql-ssl-ciphers MYSQL-SSL)"
     181            (p
     182              "Returns a " (code "string") ".") )
     183        )
    130184      )
    131185
    132       (subsection "Basic Operations"
    133 
    134         (procedure "(mysql-query DB SQL-STRING)"
     186      (subsection "Basic Query Operations"
     187
     188        (procedure "(mysql-query CONN SQL-STRING)"
    135189          (p
    136190            "Executes " (tt "SQL-STRING") " on the MySQL server "
     
    138192            "if the query fails.") )
    139193
    140         (procedure "(mysql-fetch-row DB)"
     194        (procedure "(mysql-fetch-row CONN)"
    141195          (p
    142196            "Fetches a row from the result set returned by the "
     
    157211            "no such field exists, returns " (tt "#f") ".") )
    158212
    159         (procedure "(mysql-rewind DB)"
     213        (procedure "(mysql-field-count CONN)"
     214          (p
     215            "Returns the number of columns for the most recent query.") )
     216
     217        (procedure "(mysql-fetch-lengths CONN)"
     218          (p
     219            "Returns a " (code "u32vector") " of the lengths of the columns "
     220            "of the current row.") )
     221
     222        (procedure "(mysql-rewind CONN)"
    160223          (p
    161224            "Rewinds the result set; that is, resets the pointer used by "
     
    164227            "result set, does nothing.") )
    165228
    166         (procedure "(mysql-num-rows DB)"
     229        (procedure "(mysql-num-rows CONN)"
    167230          (p
    168231            "Returns the number of rows in the current result set. "
    169232            "If no result set exists, returns " (tt "#f") ".") )
     233
     234        (procedure "(mysql-num-fields CONN)"
     235          (p
     236            "Returns the number of fields in the current result set. "
     237            "If no result set exists, returns " (tt "#f") ".") )
     238
     239        (procedure "(mysql-affected-rows CONN)"
     240          (p
     241            "Returns a " (code "number") ".") )
    170242      )
    171243
    172       (subsection "Row Mapping"
    173 
    174         (procedure "(mysql-row-fold DB PROC INIT)"
     244      (subsection "Query Row Mapping"
     245
     246        (procedure "(mysql-row-fold CONN PROC INIT)"
    175247          (p
    176248            "Iterates over the entire result set (regardless of any rows that may "
     
    183255            (url "#rowobj" "described") ") for " (tt "mysql-fetch-row") ", "
    184256            "the index of that row in the result set, starting with " (tt "1") " "
    185             "and ending with " (tt "(mysql-num-rows DB)") ", and the "
     257            "and ending with " (tt "(mysql-num-rows CONN)") ", and the "
    186258            "current accumulated value (initially " (tt "INIT") ").")
    187259          (p
    188260            (tt "PROC") " must return a value.") )
    189261
    190         (procedure "(mysql-row-for-each DB PROC)"
     262        (procedure "(mysql-row-for-each CONN PROC)"
    191263          (p
    192264            "Iterates over the entire result set (regardless of any rows that "
     
    197269            (url "#rowobj" "described") ") for " (tt "mysql-fetch-row")
    198270            ", and the index of that row in the result set, starting with "
    199             (tt "1") " and ending with " (tt "(mysql-num-rows DB)") ".") )
    200 
    201         (procedure "(mysql-row-map DB PROC)"
     271            (tt "1") " and ending with " (tt "(mysql-num-rows CONN)") ".") )
     272
     273        (procedure "(mysql-row-map CONN PROC)"
    202274          (p
    203275            "Iterates over the entire result set (regardless of any rows that "
     
    210282            (url "#rowobj" "described") ") for " (tt "mysql-fetch-row")
    211283            ", and the index of that row in the result set, starting "
    212             "with " (tt "1") " and ending with " (tt "(mysql-num-rows DB)") ".")
     284            "with " (tt "1") " and ending with " (tt "(mysql-num-rows CONN)") ".")
    213285          (p
    214286            (tt "PROC") " must return a value.") )
    215287
    216         (procedure "(mysql-query-fold DB QUERY PROC INIT)"
     288        (procedure "(mysql-query-fold CONN QUERY PROC INIT)"
    217289          (p
    218290            "Combines " (tt "mysql-query") " and " (tt "mysql-row-fold") ".") )
    219291
    220         (procedure "(mysql-query-for-each DB QUERY PROC)"
     292        (procedure "(mysql-query-for-each CONN QUERY PROC)"
    221293          (p
    222294            "Combines " (tt "mysql-query") " and " (tt "mysql-row-for-each") ".") )
    223295
    224         (procedure "(mysql-query-map DB QUERY PROC)"
     296        (procedure "(mysql-query-map CONN QUERY PROC)"
    225297          (p
    226298            "Combines " (tt "mysql-query") " and " (tt "mysql-row-map") ".") )
    227299
    228         (procedure "(mysql-foreach-row DB BODY)"
     300        (procedure "(mysql-foreach-row CONN BODY)"
    229301          (p
    230302            "Synonym for " (code "mysql-row-for-each") ".") )
    231303
    232         (procedure "(mysql-query-foreach DB QUERY BODY)"
     304        (procedure "(mysql-query-foreach CONN QUERY BODY)"
    233305          (p
    234306            "Synonym for " (code "mysql-query-for-each") ".") )
    235307      )
    236308
    237       (subsection "Field Access"
    238 
    239         (subsubsection "Field Set Access"
    240 
    241           (procedure "(mysql-field-slots MYSQL-FIELD-POINTER MYSQL-FIELD-GETTER ...)"
    242             (p
    243               "Returns a list of MYSQL_FIELD entry values, "
    244               "from each " (tt "MYSQL-FIELD-GETTER") ".")
    245             (p
    246               (tt "MYSQL-FIELD-POINTER") " is a pointer to a MYSQL_FIELD, or "
    247               (code "#f") ". "
    248               (tt "MYSQL-FIELD-GETTER") " is a " (code "mysql-field-*") " "
    249               "reference function.") )
    250 
    251           (procedure "(mysql-fetch-field-slots-direct DB FIELD-NUMBER MYSQL-FIELD-GETTER ...)"
    252             (p
    253               "Combination of " (code "mysql-fetch-field-direct") " and "
    254               (code "mysql-field-slots") ".") )
    255 
    256           (procedure "(mysql-fetch-field-slots DB MYSQL-FIELD-GETTER ...)"
    257             (p
    258               "Combination of " (code "mysql-fetch-field") " and "
    259               (code "mysql-field-slots") ".") )
    260 
    261         )
    262 
    263         (subsubsection "Field Entry Access"
    264 
    265           (procedure "(mysql-field-org-name MYSQL-FIELD-POINTER)"
    266             (p
    267               "Returns " (code "string") ".") )
    268 
    269           (procedure "(mysql-field-name MYSQL-FIELD-POINTER)"
    270             (p
    271               "Returns " (code "string") ".") )
    272 
    273           (procedure "(mysql-field-org-table MYSQL-FIELD-POINTER)"
    274             (p
    275               "Returns " (code "string") ".") )
    276 
    277           (procedure "(mysql-field-org-table MYSQL-FIELD-POINTER)"
    278             (p
    279               "Returns " (code "string") ".") )
    280 
    281           (procedure "(mysql-field-db MYSQL-FIELD-POINTER)"
    282             (p
    283               "Returns " (code "string") ".") )
    284 
    285           (procedure "(mysql-field-catalog MYSQL-FIELD-POINTER)"
    286             (p
    287               "Returns " (code "string") ".") )
    288 
    289           (procedure "(mysql-field-def MYSQL-FIELD-POINTER)"
    290             (p
    291               "Returns " (code "string") ".") )
    292 
    293           (procedure "(mysql-field-table MYSQL-FIELD-POINTER)"
    294             (p
    295               "Returns " (code "string") ".") )
    296 
    297           (procedure "(mysql-field-type MYSQL-FIELD-POINTER)"
    298             (p
    299               "Returns " (code "enum enum_field_types value") ".") )
    300 
    301           (procedure "(mysql-field-charsetnr MYSQL-FIELD-POINTER)"
    302             (p
     309      (subsection "MYSQL_FIELD Access"
     310
     311        (procedure "(mysql-fetch-field CONN)"
     312          (p
     313            "Returns a " (code "mysql-field-ptr") " to the next field, or " (code "#f") ".") )
     314
     315        (procedure "(mysql-fetch-fields CONN)
     316          (p
     317            "Returns a " (code "mysql-field-ptr") " to the first field, or " (code "#f") ".") )
     318
     319        (procedure "(mysql-fetch-field-direct CONN FIELD-NUMBER)
     320          (p
     321            "Returns a " (code "mysql-field-ptr") " to a specific field, or " (code "#f") ".") )
     322
     323        (procedure "(mysql-field-slots MYSQL-FIELD-POINTER MYSQL-FIELD-GETTER ...)"
     324          (p
     325            "Returns a list of MYSQL_FIELD entry values, "
     326            "from each " (tt "MYSQL-FIELD-GETTER") ".")
     327          (p
     328            (tt "MYSQL-FIELD-POINTER") " is a pointer to a MYSQL_FIELD, or "
     329            (code "#f") ". "
     330            (tt "MYSQL-FIELD-GETTER") " is a " (code "mysql-field-*") " "
     331            "reference function.") )
     332
     333        (procedure "(mysql-fetch-field-slot-direct CONN FIELD-NUMBER MYSQL-FIELD-GETTER)"
     334          (p
     335            "Returns a field slot value. "
     336            "Combines " (code "mysql-fetch-field-direct") " and "
     337            (code "mysql-field-slots") ".") )
     338
     339        (procedure "(mysql-fetch-field-slot CONN MYSQL-FIELD-GETTER)"
     340          (p
     341            "Returns a field slot value. "
     342            "Combines " (code "mysql-fetch-field") " and "
     343            (code "mysql-field-slots") ".") )
     344
     345        (procedure "(mysql-fetch-field-slots-direct CONN FIELD-NUMBER MYSQL-FIELD-GETTER ...)"
     346          (p
     347            "Returns a list of field slot values. "
     348            "Combines " (code "mysql-fetch-field-direct") " and "
     349            (code "mysql-field-slots") ".") )
     350
     351        (procedure "(mysql-fetch-field-slots CONN MYSQL-FIELD-GETTER ...)"
     352          (p
     353            "Returns a list of field slot values. "
     354            "Combines " (code "mysql-fetch-field") " and "
     355            (code "mysql-field-slots") ".") )
     356
     357        (procedure "(mysql-field-org-name MYSQL-FIELD-POINTER)"
     358          (p
     359            "Returns " (code "string") ".") )
     360
     361        (procedure "(mysql-field-name MYSQL-FIELD-POINTER)"
     362          (p
     363            "Returns " (code "string") ".") )
     364
     365        (procedure "(mysql-field-org-table MYSQL-FIELD-POINTER)"
     366          (p
     367            "Returns " (code "string") ".") )
     368
     369        (procedure "(mysql-field-org-table MYSQL-FIELD-POINTER)"
     370          (p
     371            "Returns " (code "string") ".") )
     372
     373        (procedure "(mysql-field-db MYSQL-FIELD-POINTER)"
     374          (p
     375            "Returns " (code "string") ".") )
     376
     377        (procedure "(mysql-field-catalog MYSQL-FIELD-POINTER)"
     378          (p
     379            "Returns " (code "string") ".") )
     380
     381        (procedure "(mysql-field-def MYSQL-FIELD-POINTER)"
     382          (p
     383            "Returns " (code "string") ".") )
     384
     385        (procedure "(mysql-field-table MYSQL-FIELD-POINTER)"
     386          (p
     387            "Returns " (code "string") ".") )
     388
     389        (procedure "(mysql-field-type MYSQL-FIELD-POINTER)"
     390          (p
     391            "Returns " (code "enum enum_field_types value") ".") )
     392
     393        (procedure "(mysql-field-charsetnr MYSQL-FIELD-POINTER)"
     394          (p
     395            "Returns " (code "unsigned-integer") ".") )
     396
     397        (procedure "(mysql-field-flags MYSQL-FIELD-POINTER)"
     398          (p
     399            "Returns " (code "unsigned-integer") ".") )
     400
     401        (procedure "(mysql-field-decimals MYSQL-FIELD-POINTER)"
     402          (p
     403            "Returns " (code "unsigned-integer") ".") )
     404
     405        (procedure "(mysql-field-def-length MYSQL-FIELD-POINTER)"
     406          (p
     407            "Returns " (code "unsigned-integer") ".") )
     408
     409        (procedure "(mysql-field-catalog-length MYSQL-FIELD-POINTER)"
     410          (p
     411            "Returns " (code "unsigned-integer") ".") )
     412
     413        (procedure "(mysql-field-db-length MYSQL-FIELD-POINTER)"
     414          (p
     415            "Returns " (code "unsigned-integer") ".") )
     416
     417        (procedure "(mysql-field-org-table-length MYSQL-FIELD-POINTER)"
     418          (p
     419            "Returns " (code "unsigned-integer") ".") )
     420
     421        (procedure "(mysql-field-table-length MYSQL-FIELD-POINTER)"
     422          (p
     423            "Returns " (code "unsigned-integer") ".") )
     424
     425        (procedure "(mysql-field-org-name-length MYSQL-FIELD-POINTER)"
     426          (p
     427            "Returns " (code "unsigned-integer") ".") )
     428
     429        (procedure "(mysql-field-name-length MYSQL-FIELD-POINTER)"
     430          (p
     431            "Returns " (code "unsigned-integer") ".") )
     432
     433        (procedure "(mysql-field-max-length MYSQL-FIELD-POINTER)"
     434          (p
     435            "Returns " (code "unsigned-integer") ".") )
     436
     437        (procedure "(mysql-field-length MYSQL-FIELD-POINTER)"
     438          (p
    303439              "Returns " (code "unsigned-integer") ".") )
    304 
    305           (procedure "(mysql-field-flags MYSQL-FIELD-POINTER)"
    306             (p
    307               "Returns " (code "unsigned-integer") ".") )
    308 
    309           (procedure "(mysql-field-decimals MYSQL-FIELD-POINTER)"
    310             (p
    311               "Returns " (code "unsigned-integer") ".") )
    312 
    313           (procedure "(mysql-field-def-length MYSQL-FIELD-POINTER)"
    314             (p
    315               "Returns " (code "unsigned-integer") ".") )
    316 
    317           (procedure "(mysql-field-catalog-length MYSQL-FIELD-POINTER)"
    318             (p
    319               "Returns " (code "unsigned-integer") ".") )
    320 
    321           (procedure "(mysql-field-db-length MYSQL-FIELD-POINTER)"
    322             (p
    323               "Returns " (code "unsigned-integer") ".") )
    324 
    325           (procedure "(mysql-field-org-table-length MYSQL-FIELD-POINTER)"
    326             (p
    327               "Returns " (code "unsigned-integer") ".") )
    328 
    329           (procedure "(mysql-field-table-length MYSQL-FIELD-POINTER)"
    330             (p
    331               "Returns " (code "unsigned-integer") ".") )
    332 
    333           (procedure "(mysql-field-org-name-length MYSQL-FIELD-POINTER)"
    334             (p
    335               "Returns " (code "unsigned-integer") ".") )
    336 
    337           (procedure "(mysql-field-name-length MYSQL-FIELD-POINTER)"
    338             (p
    339               "Returns " (code "unsigned-integer") ".") )
    340 
    341           (procedure "(mysql-field-max-length MYSQL-FIELD-POINTER)"
    342             (p
    343               "Returns " (code "unsigned-integer") ".") )
    344 
    345           (procedure "(mysql-field-length MYSQL-FIELD-POINTER)"
    346             (p
    347               "Returns " (code "unsigned-integer") ".") )
     440      )
     441
     442      (subsection "Character Set Access"
     443
     444        (procedure "(mysql-set-character-set CONN CHARACTER-SET-NAME)"
     445          (p
     446            "Sets the current character set.") )
     447
     448        (procedure "(mysql-character-set-name CONN)"
     449          (p
     450            "Returns a " (tt "string") ".") )
     451
     452        (procedure "(mysql-get-character-set-info CONN)"
     453          (p
     454            "Returns a " (tt "MY-CHARSET-INFO-POINTER") ".") )
     455
     456        (subsubsection "Slot Getters"
     457
     458          (procedure "(my-charset-info-name MY-CHARSET-INFO-POINTER)"
     459            (p
     460              "Return a " (code "string") ".") )
     461
     462          (procedure "(my-charset-info-csname MY-CHARSET-INFO-POINTER)"
     463            (p
     464              "Return a " (code "string") ".") )
     465
     466          (procedure "(my-charset-info-comment MY-CHARSET-INFO-POINTER)"
     467            (p
     468              "Return a " (code "string") ".") )
     469
     470          (procedure "(my-charset-info-dir MY-CHARSET-INFO-POINTER)"
     471            (p
     472              "Return a " (code "string") ".") )
     473
     474          (procedure "(my-charset-info-mbminlen MY-CHARSET-INFO-POINTER)"
     475            (p
     476              "Return a " (code "number") ".") )
     477
     478          (procedure "(my-charset-info-mbmaxlen MY-CHARSET-INFO-POINTER)"
     479            (p
     480              "Return a " (code "number") ".") )
    348481        )
    349482      )
    350483
    351       (subsection "Enumeration Values"
    352 
    353         (symbol-table "enum enum_mysql_set_option"
    354           (describe mysql-option-multi-statements-on "MYSQL_OPTION_MULTI_STATEMENTS_ON")
    355           (describe mysql-option-multi-statements-off "MYSQL_OPTION_MULTI_STATEMENTS_OFF") )
    356 
    357         (symbol-table "enum mysql_option"
    358           (describe mysql-opt-connect-timeout "MYSQL_OPT_CONNECT_TIMEOUT")
    359           (describe mysql-opt-compress "MYSQL_OPT_COMPRESS")
    360           (describe mysql-opt-named-pipe "MYSQL_OPT_NAMED_PIPE")
    361           (describe mysql-init-command "MYSQL_INIT_COMMAND")
    362           (describe mysql-read-default-file "MYSQL_READ_DEFAULT_FILE")
    363           (describe mysql-read-default-group "MYSQL_READ_DEFAULT_GROUP")
    364           (describe mysql-set-charset-dir "MYSQL_SET_CHARSET_DIR")
    365           (describe mysql-set-charset-name "MYSQL_SET_CHARSET_NAME")
    366           (describe mysql-opt-local-infile "MYSQL_OPT_LOCAL_INFILE")
    367           (describe mysql-opt-protocol "MYSQL_OPT_PROTOCOL")
    368           (describe mysql-shared-memory-base-name "MYSQL_SHARED_MEMORY_BASE_NAME")
    369           (describe mysql-opt-read-timeout "MYSQL_OPT_READ_TIMEOUT")
    370           (describe mysql-opt-write-timeout "MYSQL_OPT_WRITE_TIMEOUT")
    371           (describe mysql-opt-use-result "MYSQL_OPT_USE_RESULT")
    372           (describe mysql-opt-use-remote-connection "MYSQL_OPT_USE_REMOTE_CONNECTION")
    373           (describe mysql-opt-use-embedded-connection "MYSQL_OPT_USE_EMBEDDED_CONNECTION")
    374           (describe mysql-opt-guess-connection "MYSQL_OPT_GUESS_CONNECTION")
    375           (describe mysql-set-client-ip "MYSQL_SET_CLIENT_IP")
    376           (describe mysql-secure-auth "MYSQL_SECURE_AUTH")
    377           (describe mysql-report-data-truncation "MYSQL_REPORT_DATA_TRUNCATION") )
    378 
    379         (symbol-table "enum enum_field_types"
    380           (describe mysql-type-decimal "MYSQL_TYPE_DECIMAL")
    381           (describe mysql-type-tiny "MYSQL_TYPE_TINY")
    382           (describe mysql-type-short "MYSQL_TYPE_SHORT")
    383           (describe mysql-type-long "MYSQL_TYPE_LONG")
    384           (describe mysql-type-float "MYSQL_TYPE_FLOAT")
    385           (describe mysql-type-double "MYSQL_TYPE_DOUBLE")
    386           (describe mysql-type-null "MYSQL_TYPE_NULL")
    387           (describe mysql-type-timestamp "MYSQL_TYPE_TIMESTAMP")
    388           (describe mysql-type-longlong "MYSQL_TYPE_LONGLONG")
    389           (describe mysql-type-int24 "MYSQL_TYPE_INT24")
    390           (describe mysql-type-date "MYSQL_TYPE_DATE")
    391           (describe mysql-type-time "MYSQL_TYPE_TIME")
    392           (describe mysql-type-datetime "MYSQL_TYPE_DATETIME")
    393           (describe mysql-type-year "MYSQL_TYPE_YEAR")
    394           (describe mysql-type-newdate "MYSQL_TYPE_NEWDATE")
    395           (describe mysql-type-varchar "MYSQL_TYPE_VARCHAR")
    396           (describe mysql-type-bit "MYSQL_TYPE_BIT")
    397           (describe mysql-type-newdecimal "MYSQL_TYPE_NEWDECIMAL")
    398           (describe mysql-type-enum "MYSQL_TYPE_ENUM")
    399           (describe mysql-type-set "MYSQL_TYPE_SET")
    400           (describe mysql-type-tiny-blob "MYSQL_TYPE_TINY_BLOB")
    401           (describe mysql-type-medium-blob "MYSQL_TYPE_MEDIUM_BLOB")
    402           (describe mysql-type-long-blob "MYSQL_TYPE_LONG_BLOB")
    403           (describe mysql-type-blob "MYSQL_TYPE_BLOB")
    404           (describe mysql-type-var-string "MYSQL_TYPE_VAR_STRING")
    405           (describe mysql-type-string "MYSQL_TYPE_STRING")
    406           (describe mysql-type-geometry "MYSQL_TYPE_GEOMETRY") )
    407 
    408         (symbol-table "MYSQL_FIELD flags"
    409           (describe not-null-flag "NOT-NULL-FLAG")
    410           (describe pri-key-flag "PRI-KEY-FLAG")
    411           (describe unique-key-flag "UNIQUE-KEY-FLAG")
    412           (describe multiple-key-flag "MULTIPLE-KEY-FLAG")
    413           (describe unsigned-flag "UNSIGNED-FLAG")
    414           (describe zerofill-flag "ZEROFILL-FLAG")
    415           (describe binary-flag "BINARY-FLAG")
    416           (describe auto-increment-flag "AUTO-INCREMENT-FLAG")
    417           (describe no-default-value-flag "NO-DEFAULT-VALUE-FLAG") )
     484      (subsection "Miscellaneous Procedures"
     485
     486        (procedure "(mysql-change-user CONN [KEYWORD ...])
     487          (p
     488            "Changes the user identity.")
     489          (p
     490            "Any number of the following " (tt "KEYWORD ...") " may be included:"
     491            (ul
     492              (li (tt "user"))
     493              (li (tt "passwd"))
     494              (li (tt "db")))) )
     495
     496        (procedure "(mysql-debug debug)
     497          (p
     498            ".") )
     499
     500        (procedure "(mysql-dump-debug-info CONN)
     501          (p
     502            ".") )
     503
     504        (procedure "(mysql-errno CONN)
     505          (p
     506            ".") )
     507
     508        (procedure "(mysql-error CONN)
     509          (p
     510            "Returns a string describing the last mysql error, or #f if no error has occurred.") )
     511
     512        (procedure "(mysql-escape-string CONN SQL)
     513          (p
     514            "Returns an escape encoded form of the " (tt "SQL") " string.") )
     515
     516        (procedure "(mysql-free-result CONN)
     517          (p
     518            ".") )
     519
     520        (procedure "(mysql-get-client-info)
     521          (p
     522            ".") )
     523
     524        (procedure "(mysql-get-client-version)
     525          (p
     526            ".") )
     527
     528        (procedure "(mysql-get-host-info CONN)
     529          (p
     530            ".") )
     531
     532        (procedure "(mysql-get-proto-info CONN)
     533          (p
     534            ".") )
     535
     536        (procedure "(mysql-get-server-info CONN)
     537          (p
     538            ".") )
     539
     540        (procedure "(mysql-get-server-version CONN)
     541          (p
     542            ".") )
     543
     544        (procedure "(mysql-info CONN)
     545          (p
     546            ".") )
     547
     548        (procedure "(mysql-insert-id CONN)
     549          (p
     550            ".") )
     551
     552        (procedure "(mysql-kill CONN PID)
     553          (p
     554            ".") )
     555
     556        (procedure "(mysql-list-dbs CONN LIKE)
     557          (p
     558            ".") )
     559
     560        (procedure "(mysql-list-fields CONN TABLE WILD)
     561          (p
     562            ".") )
     563
     564        (procedure "(mysql-list-processes CONN)
     565          (p
     566            ".") )
     567
     568        (procedure "(mysql-list-tables CONN WILD)
     569          (p
     570            ".") )
     571
     572        (procedure "(mysql-num-fields CONN)
     573          (p
     574            ".") )
     575
     576        (procedure "(mysql-num-rows CONN)
     577          (p
     578            ".") )
     579
     580        (procedure "(mysql-ping CONN)
     581          (p
     582            ".") )
     583
     584        (procedure "(mysql-select-db CONN DB)
     585          (p
     586            "Returns " (code "#t") " if the select was successful, "
     587            "signals exception otherwise.") )
     588
     589        (procedure "(mysql-stat CONN)
     590          (p
     591            ".") )
     592
     593        (procedure "(mysql-store-result CONN)
     594          (p
     595            ".") )
     596
     597        (procedure "(mysql-thread-id CONN)
     598          (p
     599            ".") )
     600      )
     601
     602      (subsection "Enumerations & Flags"
     603
     604        (subsubsection "Client Flags"
     605
     606          (symbol-table "Symbolic Value"
     607            (describe client-compress "CLIENT_COMPRESS")
     608            (describe client-found-rows "CLIENT_FOUND_ROWS")
     609            (describe client-ignore-sigpipe "CLIENT_IGNORE_SIGPIPE")
     610            (describe client-ignore-space "CLIENT_IGNORE_SPACE")
     611            (describe client-interactive "CLIENT_INTERACTIVE")
     612            (describe client-local-files "CLIENT_LOCAL_FILES")
     613            (describe client-multi-results "CLIENT_MULTI_RESULTS")
     614            (describe client-multi-statements "CLIENT_MULTI_STATEMENTS")
     615            (describe client-no-schema "CLIENT_NO_SCHEMA")
     616            (describe client-odbc "CLIENT_ODBC")
     617            (describe client-ssl "CLIENT_SSL") )
     618
     619          (procedure "(mysql-client-flags-value FLAG ...)"
     620            (p
     621              "Returns the or'ed value of the " (tt "FLAG ...") ".") )
     622
     623          (procedure "(mysql-client-flags-symbol NUMBER)"
     624            (p
     625              "Returns the symbol for the " (tt "NUMBER") ".") )
     626        )
     627
     628        (subsubsection "enum enum_mysql_set_option"
     629
     630          (symbol-table "Symbolic Value"
     631            (describe mysql-option-multi-statements-on "MYSQL_OPTION_MULTI_STATEMENTS_ON")
     632            (describe mysql-option-multi-statements-off "MYSQL_OPTION_MULTI_STATEMENTS_OFF") )
     633
     634          (procedure "(mysql-server-option-value FLAG ...)"
     635            (p
     636              "Returns the or'ed value of the " (tt "FLAG ...") ".") )
     637
     638          (procedure "(mysql-server-option-symbol NUMBER)"
     639            (p
     640              "Returns the symbol for the " (tt "NUMBER") ".") )
     641        )
     642
     643        (subsubsection "enum mysql_option"
     644
     645          (symbol-table "Symbolic Value"
     646            (describe mysql-opt-connect-timeout "MYSQL_OPT_CONNECT_TIMEOUT")
     647            (describe mysql-opt-compress "MYSQL_OPT_COMPRESS")
     648            (describe mysql-opt-named-pipe "MYSQL_OPT_NAMED_PIPE")
     649            (describe mysql-init-command "MYSQL_INIT_COMMAND")
     650            (describe mysql-read-default-file "MYSQL_READ_DEFAULT_FILE")
     651            (describe mysql-read-default-group "MYSQL_READ_DEFAULT_GROUP")
     652            (describe mysql-set-charset-dir "MYSQL_SET_CHARSET_DIR")
     653            (describe mysql-set-charset-name "MYSQL_SET_CHARSET_NAME")
     654            (describe mysql-opt-local-infile "MYSQL_OPT_LOCAL_INFILE")
     655            (describe mysql-opt-protocol "MYSQL_OPT_PROTOCOL")
     656            (describe mysql-shared-memory-base-name "MYSQL_SHARED_MEMORY_BASE_NAME")
     657            (describe mysql-opt-read-timeout "MYSQL_OPT_READ_TIMEOUT")
     658            (describe mysql-opt-write-timeout "MYSQL_OPT_WRITE_TIMEOUT")
     659            (describe mysql-opt-use-result "MYSQL_OPT_USE_RESULT")
     660            (describe mysql-opt-use-remote-connection "MYSQL_OPT_USE_REMOTE_CONNECTION")
     661            (describe mysql-opt-use-embedded-connection "MYSQL_OPT_USE_EMBEDDED_CONNECTION")
     662            (describe mysql-opt-guess-connection "MYSQL_OPT_GUESS_CONNECTION")
     663            (describe mysql-set-client-ip "MYSQL_SET_CLIENT_IP")
     664            (describe mysql-secure-auth "MYSQL_SECURE_AUTH")
     665            (describe mysql-report-data-truncation "MYSQL_REPORT_DATA_TRUNCATION") )
     666
     667          (procedure "(mysql-option-value FLAG ...)"
     668            (p
     669              "Returns the or'ed value of the " (tt "FLAG ...") ".") )
     670
     671          (procedure "(mysql-option-symbol NUMBER)"
     672            (p
     673              "Returns the symbol for the " (tt "NUMBER") ".") )
     674        )
     675
     676        (subsubsection "enum enum_field_types"
     677
     678          (symbol-table "Symbolic Value"
     679            (describe mysql-type-decimal "MYSQL_TYPE_DECIMAL")
     680            (describe mysql-type-tiny "MYSQL_TYPE_TINY")
     681            (describe mysql-type-short "MYSQL_TYPE_SHORT")
     682            (describe mysql-type-long "MYSQL_TYPE_LONG")
     683            (describe mysql-type-float "MYSQL_TYPE_FLOAT")
     684            (describe mysql-type-double "MYSQL_TYPE_DOUBLE")
     685            (describe mysql-type-null "MYSQL_TYPE_NULL")
     686            (describe mysql-type-timestamp "MYSQL_TYPE_TIMESTAMP")
     687            (describe mysql-type-longlong "MYSQL_TYPE_LONGLONG")
     688            (describe mysql-type-int24 "MYSQL_TYPE_INT24")
     689            (describe mysql-type-date "MYSQL_TYPE_DATE")
     690            (describe mysql-type-time "MYSQL_TYPE_TIME")
     691            (describe mysql-type-datetime "MYSQL_TYPE_DATETIME")
     692            (describe mysql-type-year "MYSQL_TYPE_YEAR")
     693            (describe mysql-type-newdate "MYSQL_TYPE_NEWDATE")
     694            (describe mysql-type-varchar "MYSQL_TYPE_VARCHAR")
     695            (describe mysql-type-bit "MYSQL_TYPE_BIT")
     696            (describe mysql-type-newdecimal "MYSQL_TYPE_NEWDECIMAL")
     697            (describe mysql-type-enum "MYSQL_TYPE_ENUM")
     698            (describe mysql-type-set "MYSQL_TYPE_SET")
     699            (describe mysql-type-tiny-blob "MYSQL_TYPE_TINY_BLOB")
     700            (describe mysql-type-medium-blob "MYSQL_TYPE_MEDIUM_BLOB")
     701            (describe mysql-type-long-blob "MYSQL_TYPE_LONG_BLOB")
     702            (describe mysql-type-blob "MYSQL_TYPE_BLOB")
     703            (describe mysql-type-var-string "MYSQL_TYPE_VAR_STRING")
     704            (describe mysql-type-string "MYSQL_TYPE_STRING")
     705            (describe mysql-type-geometry "MYSQL_TYPE_GEOMETRY") )
     706
     707          (procedure "(mysql-type-value FLAG ...)"
     708            (p
     709              "Returns the or'ed value of the " (tt "FLAG ...") ".") )
     710
     711          (procedure "(mysql-type-symbol NUMBER)"
     712            (p
     713              "Returns the symbol for the " (tt "NUMBER") ".") )
     714        )
     715
     716        (subsubsection "MYSQL_FIELD.flags Flags"
     717
     718          (symbol-table "Symbolic Value"
     719            (describe not-null-flag "NOT-NULL-FLAG")
     720            (describe pri-key-flag "PRI-KEY-FLAG")
     721            (describe unique-key-flag "UNIQUE-KEY-FLAG")
     722            (describe multiple-key-flag "MULTIPLE-KEY-FLAG")
     723            (describe unsigned-flag "UNSIGNED-FLAG")
     724            (describe zerofill-flag "ZEROFILL-FLAG")
     725            (describe binary-flag "BINARY-FLAG")
     726            (describe auto-increment-flag "AUTO-INCREMENT-FLAG")
     727            (describe no-default-value-flag "NO-DEFAULT-VALUE-FLAG") )
     728
     729          (procedure "(mysql-field-flags-value FLAG ...)"
     730            (p
     731              "Returns the or'ed value of the " (tt "FLAG ...") ".") )
     732
     733          (procedure "(mysql-field-flags-symbol NUMBER)"
     734            (p
     735              "Returns the symbol for the " (tt "NUMBER") ".") )
     736        )
    418737      )
    419738    ) ; documentation
  • release/3/mysql/tags/1.3/mysql-tests-body.scm

    r7926 r7930  
    44
    55(use mysql)
     6
     7;;;
    68
    79(define (collect-until proc pred)
     
    1315  (collect-until proc (complement pred)) )
    1416
    15 (define (mysql-fetch-field-items conn . getters)
    16   (collect-while (lambda () (apply mysql-fetch-field-slots conn getters)) identity) )
     17;;;
    1718
    1819(define (mysql-fetch-field-item conn getter)
    1920  (collect-while (lambda () (mysql-fetch-field-slot conn getter)) identity) )
    2021
     22#; ;UNUSED
     23(define (mysql-fetch-field-items conn . getters)
     24  (collect-while (lambda () (apply mysql-fetch-field-slots conn getters)) identity) )
     25
     26;;;
     27
    2128(print "Opening the connection")
    22 (define *db* (mysql-connect user: *user* passwd: *passwd* host: *host*))
    23 (print "Database: " *db*)
     29(define *conn* (mysql-connect user: *user* passwd: *passwd* host: *host*))
     30(print "Database: " *conn*)
    2431
    25 (unless *db*
     32(unless *conn*
    2633  (print "Unable to connect to database.")
    2734  (print "You might want to edit \"mysql-tests.scm\" to set *user*, *passwd*, and *host*.")
    2835  (exit) )
    2936
    30 (print "MySQL errno: " (mysql-errno *db*))
    31 (print "MySQL error: " (mysql-error *db*))
     37(print "MySQL errno: " (mysql-errno *conn*))
     38(print "MySQL error: " (mysql-error *conn*))
    3239(newline)
    3340
    34 (define (mysql-print-and-query *db* query)
     41(define (mysql-print-and-query *conn* query)
    3542  (print "QUERY: " query)
    36   (mysql-query *db* query))
     43  (mysql-query *conn* query))
    3744
    3845(print "Performing query: SHOW DATABASES")
    39 (mysql-print-and-query *db* "SHOW DATABASES")
    40 (print "Number of rows: " (mysql-num-rows *db*))
     46(mysql-print-and-query *conn* "SHOW DATABASES")
     47(print "Number of rows: " (mysql-num-rows *conn*))
    4148
    4249(newline)
    4350(print "The rows can be enumerated one-per-line, like this:")
    44 (mysql-foreach-row *db* (lambda (row row-idx)
     51(mysql-foreach-row *conn* (lambda (row row-idx)
    4552  (display (conc row-idx ": " (row "Database") "\n"))))
    4653
    4754(newline)
    4855(display "Or they can just be comma-separated, like so:")
    49 (mysql-foreach-row *db* (lambda (row row-idx)
     56(mysql-foreach-row *conn* (lambda (row row-idx)
    5057  (display (conc (row "Database")
    51                  (if (< row-idx (mysql-num-rows *db*)) ", " "\n")))))
     58                 (if (< row-idx (mysql-num-rows *conn*)) ", " "\n")))))
    5259
    53 (mysql-print-and-query *db* "DROP DATABASE IF EXISTS mysql_egg_test")
     60(mysql-print-and-query *conn* "DROP DATABASE IF EXISTS mysql_egg_test")
    5461
    55 (mysql-print-and-query *db* "CREATE DATABASE mysql_egg_test")
     62(mysql-print-and-query *conn* "CREATE DATABASE mysql_egg_test")
    5663
    5764(print "selecting database: mysql_egg_test")
    58 (mysql-select-db *db* "mysql_egg_test")
     65(mysql-select-db *conn* "mysql_egg_test")
    5966
    6067(newline)
    61 (mysql-print-and-query *db* "CREATE TABLE test1 (
     68(mysql-print-and-query *conn* "CREATE TABLE test1 (
    6269  id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    6370  testboolnn BOOLEAN NOT NULL,
     
    6673
    6774(newline)
    68 (mysql-print-and-query *db*
     75(mysql-print-and-query *conn*
    6976  "INSERT INTO test1 SET testboolnn=TRUE, testbool=NULL")
    70 (mysql-print-and-query *db*
     77(mysql-print-and-query *conn*
    7178  "INSERT INTO test1 SET testboolnn=FALSE, testbool=FALSE")
    7279
    7380(newline)
    74 (mysql-print-and-query *db* "SELECT testboolnn, testbool FROM test1")
    75 (mysql-foreach-row *db* (lambda (row idx)
     81(mysql-print-and-query *conn* "SELECT testboolnn, testbool FROM test1")
     82(mysql-foreach-row *conn* (lambda (row idx)
    7683  (display (conc "row " idx ": testboolnn=" (row "testboolnn")
    7784                 ", testbool="
     
    7986
    8087(newline)
    81 (mysql-print-and-query *db* "SELECT testboolnn, testbool FROM test1")
    82 (let ([names (mysql-fetch-field-item *db* mysql-field-name)])
     88(mysql-print-and-query *conn* "SELECT testboolnn, testbool FROM test1")
     89(let ([names (mysql-fetch-field-item *conn* mysql-field-name)])
    8390  (pretty-print
    8491   (mysql-row-map
    85      *db*
     92     *conn*
    8693     (lambda (row idx)
    8794       (map (lambda (f) (cons f (row f))) names)))) )
    8895
    8996(newline)
    90 (mysql-print-and-query *db* "SELECT testboolnn, testbool FROM test1")
     97(mysql-print-and-query *conn* "SELECT testboolnn, testbool FROM test1")
    9198(mysql-row-for-each
    92   *db*
     99  *conn*
    93100  (lambda (row idx)
    94     (print "Row " idx " lengths: " (mysql-fetch-lengths *db*))))
     101    (print "Row " idx " lengths: " (mysql-fetch-lengths *conn*))))
    95102
    96103;; Finished
    97104(newline)
    98105(print "Closing the connection")
    99 (mysql-close *db*)
     106(mysql-close *conn*)
  • release/3/mysql/tags/1.3/mysql.meta

    r2988 r7930  
    66 (category db)
    77 (egg "mysql.egg")
    8  (files "mysql.setup" "mysql.scm" "mysqlaux.c" "mysqlaux.h"))
     8 (files "mysql.setup"
     9        "mysql.scm"
     10        "mysql.html" "mysql-mole.html"
     11        "mysql-tests-body.scm") )
  • release/3/mysql/tags/1.3/mysql.scm

    r7926 r7930  
    7676#>
    7777#include <mysql.h>
    78 #include "mysqlaux.h"
    7978<#
    8079
     
    252251                #;mysql-next-result ; omitted (too new)
    253252
     253    ;;
     254    make-mysql-options
     255
    254256    ;; ssl parameters api
    255257    make-mysql-ssl
     
    439441;-----------------------------------------------------------------------
    440442; Private enumeration value constants
     443;
    441444
    442445(define-foreign-enum (mysql-server-option (enum "enum_mysql_set_option"))
     
    557560;-----------------------------------------------------------------------
    558561; Public enumeration value constants
     562;
    559563
    560564(define-macro (gen-public-enum ?typ . ?syms)
     
    656660
    657661;-----------------------------------------------------------------------
    658 ; Struct API
     662; MySQL C Structures API
     663;
    659664
    660665(define-foreign-record (mysql-field "MYSQL_FIELD")
     
    700705; "double" in the C interface, converting to "my_ulonglong"
    701706; to/from the MySQL API.
     707;
    702708
    703709#>
     
    11201126;
    11211127
     1128#>
     1129/*
     1130 * Returns NULL if the idx is out of bounds; the string value of the requested
     1131 * field, otherwise.
     1132 */
     1133static char *mysqlaux_column_idx(MYSQL *mysql, MYSQL_RES *result, MYSQL_ROW row,
     1134                                                                unsigned int idx)
     1135{
     1136  if (idx >= 0 && mysql_num_fields(result) > idx) {
     1137    return (char*)row[idx];
     1138  } else {
     1139    return NULL;
     1140  }
     1141}
     1142
     1143/*
     1144 * Returns NULL if the name doesn't exist as a column name in the result
     1145 * set (case insensitive comparison). Otherwise, the string value of the
     1146 * resquested field is returned.
     1147 *
     1148 * (According to
     1149 *    http://dev.mysql.com/doc/mysql/en/name-case-sensitivity.html
     1150 * column names are never case sensitive.)
     1151 */
     1152static char *mysqlaux_column_name(MYSQL *mysql, MYSQL_RES *result, MYSQL_ROW row,
     1153                                                                const char *name)
     1154{
     1155  unsigned int num_fields;
     1156  unsigned int i;
     1157  MYSQL_FIELD *fields;
     1158
     1159  num_fields = mysql_field_count(mysql);
     1160  fields = mysql_fetch_fields(result);
     1161
     1162  for(i = 0; i < num_fields; i++) {
     1163    if (strcasecmp(name, fields[i].name) == 0) {
     1164      return row[i];
     1165    }
     1166  }
     1167
     1168  return NULL;
     1169}
     1170<#
     1171
    11221172; char *mysqlaux_column_idx(MYSQL *, MYSQL_RES *, MYSQL_ROW, unsigned int);
    11231173(define foreign-mysqlaux-column-idx
     
    11441194;-----------------------------------------------------------------------
    11451195; MySQL exceptions
     1196;
    11461197
    11471198(define (make-exn-condition loc msg . args)
     
    11671218; See <http://www.openssl.org/docs/apps/ciphers.html> for a discussion
    11681219; of the cipher-list format.
     1220;
    11691221
    11701222(define-record-type mysql-ssl
     
    11971249      ">")
    11981250     out) ) )
     1251
     1252;-----------------------------------------------------------------------
     1253; MySQL connection options helper.
     1254;
     1255
     1256(define (make-mysql-options . opts)
     1257  (let loop ([opts opts] [alst '()])
     1258    (if (null? opts)
     1259        alst
     1260        (let* ([opt (car opts)]
     1261               [nxt (cdr opts)]
     1262               [val (if (null? nxt)
     1263                        (error 'make-options "missing value for option" opt)
     1264                        (car nxt))])
     1265          (unless (number? opt)
     1266            (error 'make-options "invalid option" opt) )
     1267          (unless (or (number? val) (string? val) (not val) (null? val))
     1268            (error 'make-options "invalid option value" val) )
     1269          (loop (cdr nxt) (alist-cons opt val alst)) ) ) ) )
    11991270
    12001271;-----------------------------------------------------------------------
     
    14271498  (foreign-mysql-get-host-info (mysql-connection-ptr conn)) )
    14281499
    1429 ;
    14301500(define (mysql-get-proto-info conn)
    14311501  (foreign-mysql-get-proto-info (mysql-connection-ptr conn)) )
     
    16011671;-----------------------------------------------------------------------
    16021672; The MySQL Field structure multi-slot API.
     1673;
    16031674
    16041675; returns a list of field items.
  • release/3/mysql/tags/1.3/mysql.setup

    r7925 r7930  
    2121        ,@(if has-exports? '(-check-imports -emit-exports mysql.exports) '())
    2222  ,mysql-header-search-option -lmysqlclient -lz
    23   mysqlaux.c mysql.scm)
     23  mysql.scm)
    2424
    2525(install-extension 'mysql
  • release/3/mysql/trunk/eggdoc-mysql.scm

    r7925 r7930  
    8585
    8686      (subsection "Exceptions"
    87      
     87
    8888        (p
    8989          "Conditions of the kind " (code "(exn mysql)") " are signaled "
     
    103103            "Returns a MySQL connection object suitable for passing to "
    104104            "the other MySQL functions. This object is referred to as "
    105             (tt "DB") " when passed by all the other MySQL functions. "
     105            (tt "CONN") " when passed by all the other MySQL functions. "
    106106            "Signals an exception when the connection fails.")
    107107          (p
    108108            "Any number of the following " (tt "KEYWORDS") " may be included:"
    109109            (ul
    110               (li "host")
    111               (li "user")
    112               (li "passwd")
    113               (li "db")
    114               (li "port")
    115               (li "unix-socket")
    116               (li "client-flag")
    117               #;(li "ssl")
    118               #;(li "options")))
     110              (li (tt "host"))
     111              (li (tt "user"))
     112              (li (tt "passwd"))
     113              (li (tt "db"))
     114              (li (tt "port"))
     115              (li (tt "unix-socket"))
     116              (li (tt "client-flag"))
     117              (li (tt "ssl") " - A " (code "mysql-ssl") " record object.")
     118              (li (tt "options") " - An association list of " (code "(<mysql-option> . <object>) ".")))
    119119          (p
    120120            "Note that default values are available for all of these "
     
    123123            "for details on how these defaults are determined.)") )
    124124
    125         (procedure "(mysql-close DB)"
    126           (p
    127             "Closes the connection to " (tt "DB") ". This frees any remaining "
     125        (procedure "(mysql-connection? OBJECT)"
     126          (p
     127            "Is the " (tt "OBJECT") " a " (code "mysql-connection") " "
     128            "record? Referred to as a " (tt "CONN").") )
     129
     130        (procedure "(mysql-close CONN)"
     131          (p
     132            "Closes the connection to " (tt "CONN") ". This frees any remaining "
    128133            "MySQL resources from memory, but invalidates the MySQL connection "
    129             "object (" (tt "DB") ") so that it may no longer be used.") )
     134            "object (" (tt "CONN") ") so that it may no longer be used.") )
     135
     136        (subsubsection "Connect Parameter Constructors"
     137
     138          (procedure "(make-mysql-options OPTION-FLAG OPTION-VALUE ...)"
     139            (p
     140              "Returns an object suitable as the " (tt "options") " parameter for "
     141              (code "mysql-connect") ".")
     142            (p
     143              "The type of the " (tt "OPTION-VALUE") " is dependent on the "
     144              (tt "OPTION-FLAG") ".") )
     145
     146          (procedure "(make-mysql-ssl [KEYWORD ...])"
     147            (p
     148              "Returns a " (code "mysql-ssl") " record.")
     149            (p
     150              "Any number of the following " (tt "KEYWORD ...") " may be included:"
     151              (ul
     152                (li (tt "key") " - pathname of key file.")
     153                (li (tt "certificate") " - pathname of certificate file.")
     154                (li (tt "certificate-authority") " - pathname of certificate authority file.")
     155                (li (tt "trusted-certificates") " - pathname of trusted certificates directory.")
     156                (li (tt "ciphers")
     157                  " - See " (url "http://www.openssl.org/docs/apps/ciphers.html"
     158                                 "OpenSSL Ciphers Man Page")))) )
     159
     160          (procedure "(mysql-ssl? OBJECT)"
     161            (p
     162              "Is the " (tt "OBJECT") " an " (code "mysql-ssl") " record?") )
     163
     164          (procedure "(mysql-ssl-key-pathname MYSQL-SSL)"
     165            (p
     166              "Returns a " (code "string") ".") )
     167
     168          (procedure "(mysql-ssl-certificate-pathname MYSQL-SSL)"
     169            (p
     170              "Returns a " (code "string") ".") )
     171
     172          (procedure "(mysql-ssl-certificate-authority-pathname MYSQL-SSL)"
     173            (p
     174              "Returns a " (code "string") ".") )
     175
     176          (procedure "(mysql-ssl-trusted-certificates-pathname MYSQL-SSL)"
     177            (p
     178              "Returns a " (code "string") ".") )
     179
     180          (procedure "(mysql-ssl-ciphers MYSQL-SSL)"
     181            (p
     182              "Returns a " (code "string") ".") )
     183        )
    130184      )
    131185
    132       (subsection "Basic Operations"
    133 
    134         (procedure "(mysql-query DB SQL-STRING)"
     186      (subsection "Basic Query Operations"
     187
     188        (procedure "(mysql-query CONN SQL-STRING)"
    135189          (p
    136190            "Executes " (tt "SQL-STRING") " on the MySQL server "
     
    138192            "if the query fails.") )
    139193
    140         (procedure "(mysql-fetch-row DB)"
     194        (procedure "(mysql-fetch-row CONN)"
    141195          (p
    142196            "Fetches a row from the result set returned by the "
     
    157211            "no such field exists, returns " (tt "#f") ".") )
    158212
    159         (procedure "(mysql-rewind DB)"
     213        (procedure "(mysql-field-count CONN)"
     214          (p
     215            "Returns the number of columns for the most recent query.") )
     216
     217        (procedure "(mysql-fetch-lengths CONN)"
     218          (p
     219            "Returns a " (code "u32vector") " of the lengths of the columns "
     220            "of the current row.") )
     221
     222        (procedure "(mysql-rewind CONN)"
    160223          (p
    161224            "Rewinds the result set; that is, resets the pointer used by "
     
    164227            "result set, does nothing.") )
    165228
    166         (procedure "(mysql-num-rows DB)"
     229        (procedure "(mysql-num-rows CONN)"
    167230          (p
    168231            "Returns the number of rows in the current result set. "
    169232            "If no result set exists, returns " (tt "#f") ".") )
     233
     234        (procedure "(mysql-num-fields CONN)"
     235          (p
     236            "Returns the number of fields in the current result set. "
     237            "If no result set exists, returns " (tt "#f") ".") )
     238
     239        (procedure "(mysql-affected-rows CONN)"
     240          (p
     241            "Returns a " (code "number") ".") )
    170242      )
    171243
    172       (subsection "Row Mapping"
    173 
    174         (procedure "(mysql-row-fold DB PROC INIT)"
     244      (subsection "Query Row Mapping"
     245
     246        (procedure "(mysql-row-fold CONN PROC INIT)"
    175247          (p
    176248            "Iterates over the entire result set (regardless of any rows that may "
     
    183255            (url "#rowobj" "described") ") for " (tt "mysql-fetch-row") ", "
    184256            "the index of that row in the result set, starting with " (tt "1") " "
    185             "and ending with " (tt "(mysql-num-rows DB)") ", and the "
     257            "and ending with " (tt "(mysql-num-rows CONN)") ", and the "
    186258            "current accumulated value (initially " (tt "INIT") ").")
    187259          (p
    188260            (tt "PROC") " must return a value.") )
    189261
    190         (procedure "(mysql-row-for-each DB PROC)"
     262        (procedure "(mysql-row-for-each CONN PROC)"
    191263          (p
    192264            "Iterates over the entire result set (regardless of any rows that "
     
    197269            (url "#rowobj" "described") ") for " (tt "mysql-fetch-row")
    198270            ", and the index of that row in the result set, starting with "
    199             (tt "1") " and ending with " (tt "(mysql-num-rows DB)") ".") )
    200 
    201         (procedure "(mysql-row-map DB PROC)"
     271            (tt "1") " and ending with " (tt "(mysql-num-rows CONN)") ".") )
     272
     273        (procedure "(mysql-row-map CONN PROC)"
    202274          (p
    203275            "Iterates over the entire result set (regardless of any rows that "
     
    210282            (url "#rowobj" "described") ") for " (tt "mysql-fetch-row")
    211283            ", and the index of that row in the result set, starting "
    212             "with " (tt "1") " and ending with " (tt "(mysql-num-rows DB)") ".")
     284            "with " (tt "1") " and ending with " (tt "(mysql-num-rows CONN)") ".")
    213285          (p
    214286            (tt "PROC") " must return a value.") )
    215287
    216         (procedure "(mysql-query-fold DB QUERY PROC INIT)"
     288        (procedure "(mysql-query-fold CONN QUERY PROC INIT)"
    217289          (p
    218290            "Combines " (tt "mysql-query") " and " (tt "mysql-row-fold") ".") )
    219291
    220         (procedure "(mysql-query-for-each DB QUERY PROC)"
     292        (procedure "(mysql-query-for-each CONN QUERY PROC)"
    221293          (p
    222294            "Combines " (tt "mysql-query") " and " (tt "mysql-row-for-each") ".") )
    223295
    224         (procedure "(mysql-query-map DB QUERY PROC)"
     296        (procedure "(mysql-query-map CONN QUERY PROC)"
    225297          (p
    226298            "Combines " (tt "mysql-query") " and " (tt "mysql-row-map") ".") )
    227299
    228         (procedure "(mysql-foreach-row DB BODY)"
     300        (procedure "(mysql-foreach-row CONN BODY)"
    229301          (p
    230302            "Synonym for " (code "mysql-row-for-each") ".") )
    231303
    232         (procedure "(mysql-query-foreach DB QUERY BODY)"
     304        (procedure "(mysql-query-foreach CONN QUERY BODY)"
    233305          (p
    234306            "Synonym for " (code "mysql-query-for-each") ".") )
    235307      )
    236308
    237       (subsection "Field Access"
    238 
    239         (subsubsection "Field Set Access"
    240 
    241           (procedure "(mysql-field-slots MYSQL-FIELD-POINTER MYSQL-FIELD-GETTER ...)"
    242             (p
    243               "Returns a list of MYSQL_FIELD entry values, "
    244               "from each " (tt "MYSQL-FIELD-GETTER") ".")
    245             (p
    246               (tt "MYSQL-FIELD-POINTER") " is a pointer to a MYSQL_FIELD, or "
    247               (code "#f") ". "
    248               (tt "MYSQL-FIELD-GETTER") " is a " (code "mysql-field-*") " "
    249               "reference function.") )
    250 
    251           (procedure "(mysql-fetch-field-slots-direct DB FIELD-NUMBER MYSQL-FIELD-GETTER ...)"
    252             (p
    253               "Combination of " (code "mysql-fetch-field-direct") " and "
    254               (code "mysql-field-slots") ".") )
    255 
    256           (procedure "(mysql-fetch-field-slots DB MYSQL-FIELD-GETTER ...)"
    257             (p
    258               "Combination of " (code "mysql-fetch-field") " and "
    259               (code "mysql-field-slots") ".") )
    260 
    261         )
    262 
    263         (subsubsection "Field Entry Access"
    264 
    265           (procedure "(mysql-field-org-name MYSQL-FIELD-POINTER)"
    266             (p
    267               "Returns " (code "string") ".") )
    268 
    269           (procedure "(mysql-field-name MYSQL-FIELD-POINTER)"
    270             (p
    271               "Returns " (code "string") ".") )
    272 
    273           (procedure "(mysql-field-org-table MYSQL-FIELD-POINTER)"
    274             (p
    275               "Returns " (code "string") ".") )
    276 
    277           (procedure "(mysql-field-org-table MYSQL-FIELD-POINTER)"
    278             (p
    279               "Returns " (code "string") ".") )
    280 
    281           (procedure "(mysql-field-db MYSQL-FIELD-POINTER)"
    282             (p
    283               "Returns " (code "string") ".") )
    284 
    285           (procedure "(mysql-field-catalog MYSQL-FIELD-POINTER)"
    286             (p
    287               "Returns " (code "string") ".") )
    288 
    289           (procedure "(mysql-field-def MYSQL-FIELD-POINTER)"
    290             (p
    291               "Returns " (code "string") ".") )
    292 
    293           (procedure "(mysql-field-table MYSQL-FIELD-POINTER)"
    294             (p
    295               "Returns " (code "string") ".") )
    296 
    297           (procedure "(mysql-field-type MYSQL-FIELD-POINTER)"
    298             (p
    299               "Returns " (code "enum enum_field_types value") ".") )
    300 
    301           (procedure "(mysql-field-charsetnr MYSQL-FIELD-POINTER)"
    302             (p
     309      (subsection "MYSQL_FIELD Access"
     310
     311        (procedure "(mysql-fetch-field CONN)"
     312          (p
     313            "Returns a " (code "mysql-field-ptr") " to the next field, or " (code "#f") ".") )
     314
     315        (procedure "(mysql-fetch-fields CONN)
     316          (p
     317            "Returns a " (code "mysql-field-ptr") " to the first field, or " (code "#f") ".") )
     318
     319        (procedure "(mysql-fetch-field-direct CONN FIELD-NUMBER)
     320          (p
     321            "Returns a " (code "mysql-field-ptr") " to a specific field, or " (code "#f") ".") )
     322
     323        (procedure "(mysql-field-slots MYSQL-FIELD-POINTER MYSQL-FIELD-GETTER ...)"
     324          (p
     325            "Returns a list of MYSQL_FIELD entry values, "
     326            "from each " (tt "MYSQL-FIELD-GETTER") ".")
     327          (p
     328            (tt "MYSQL-FIELD-POINTER") " is a pointer to a MYSQL_FIELD, or "
     329            (code "#f") ". "
     330            (tt "MYSQL-FIELD-GETTER") " is a " (code "mysql-field-*") " "
     331            "reference function.") )
     332
     333        (procedure "(mysql-fetch-field-slot-direct CONN FIELD-NUMBER MYSQL-FIELD-GETTER)"
     334          (p
     335            "Returns a field slot value. "
     336            "Combines " (code "mysql-fetch-field-direct") " and "
     337            (code "mysql-field-slots") ".") )
     338
     339        (procedure "(mysql-fetch-field-slot CONN MYSQL-FIELD-GETTER)"
     340          (p
     341            "Returns a field slot value. "
     342            "Combines " (code "mysql-fetch-field") " and "
     343            (code "mysql-field-slots") ".") )
     344
     345        (procedure "(mysql-fetch-field-slots-direct CONN FIELD-NUMBER MYSQL-FIELD-GETTER ...)"
     346          (p
     347            "Returns a list of field slot values. "
     348            "Combines " (code "mysql-fetch-field-direct") " and "
     349            (code "mysql-field-slots") ".") )
     350
     351        (procedure "(mysql-fetch-field-slots CONN MYSQL-FIELD-GETTER ...)"
     352          (p
     353            "Returns a list of field slot values. "
     354            "Combines " (code "mysql-fetch-field") " and "
     355            (code "mysql-field-slots") ".") )
     356
     357        (procedure "(mysql-field-org-name MYSQL-FIELD-POINTER)"
     358          (p
     359            "Returns " (code "string") ".") )
     360
     361        (procedure "(mysql-field-name MYSQL-FIELD-POINTER)"
     362          (p
     363            "Returns " (code "string") ".") )
     364
     365        (procedure "(mysql-field-org-table MYSQL-FIELD-POINTER)"
     366          (p
     367            "Returns " (code "string") ".") )
     368
     369        (procedure "(mysql-field-org-table MYSQL-FIELD-POINTER)"
     370          (p
     371            "Returns " (code "string") ".") )
     372
     373        (procedure "(mysql-field-db MYSQL-FIELD-POINTER)"
     374          (p
     375            "Returns " (code "string") ".") )
     376
     377        (procedure "(mysql-field-catalog MYSQL-FIELD-POINTER)"
     378          (p
     379            "Returns " (code "string") ".") )
     380
     381        (procedure "(mysql-field-def MYSQL-FIELD-POINTER)"
     382          (p
     383            "Returns " (code "string") ".") )
     384
     385        (procedure "(mysql-field-table MYSQL-FIELD-POINTER)"
     386          (p
     387            "Returns " (code "string") ".") )
     388
     389        (procedure "(mysql-field-type MYSQL-FIELD-POINTER)"
     390          (p
     391            "Returns " (code "enum enum_field_types value") ".") )
     392
     393        (procedure "(mysql-field-charsetnr MYSQL-FIELD-POINTER)"
     394          (p
     395            "Returns " (code "unsigned-integer") ".") )
     396
     397        (procedure "(mysql-field-flags MYSQL-FIELD-POINTER)"
     398          (p
     399            "Returns " (code "unsigned-integer") ".") )
     400
     401        (procedure "(mysql-field-decimals MYSQL-FIELD-POINTER)"
     402          (p
     403            "Returns " (code "unsigned-integer") ".") )
     404
     405        (procedure "(mysql-field-def-length MYSQL-FIELD-POINTER)"
     406          (p
     407            "Returns " (code "unsigned-integer") ".") )
     408
     409        (procedure "(mysql-field-catalog-length MYSQL-FIELD-POINTER)"
     410          (p
     411            "Returns " (code "unsigned-integer") ".") )
     412
     413        (procedure "(mysql-field-db-length MYSQL-FIELD-POINTER)"
     414          (p
     415            "Returns " (code "unsigned-integer") ".") )
     416
     417        (procedure "(mysql-field-org-table-length MYSQL-FIELD-POINTER)"
     418          (p
     419            "Returns " (code "unsigned-integer") ".") )
     420
     421        (procedure "(mysql-field-table-length MYSQL-FIELD-POINTER)"
     422          (p
     423            "Returns " (code "unsigned-integer") ".") )
     424
     425        (procedure "(mysql-field-org-name-length MYSQL-FIELD-POINTER)"
     426          (p
     427            "Returns " (code "unsigned-integer") ".") )
     428
     429        (procedure "(mysql-field-name-length MYSQL-FIELD-POINTER)"
     430          (p
     431            "Returns " (code "unsigned-integer") ".") )
     432
     433        (procedure "(mysql-field-max-length MYSQL-FIELD-POINTER)"
     434          (p
     435            "Returns " (code "unsigned-integer") ".") )
     436
     437        (procedure "(mysql-field-length MYSQL-FIELD-POINTER)"
     438          (p
    303439              "Returns " (code "unsigned-integer") ".") )
    304 
    305           (procedure "(mysql-field-flags MYSQL-FIELD-POINTER)"
    306             (p
    307               "Returns " (code "unsigned-integer") ".") )
    308 
    309           (procedure "(mysql-field-decimals MYSQL-FIELD-POINTER)"
    310             (p
    311               "Returns " (code "unsigned-integer") ".") )
    312 
    313           (procedure "(mysql-field-def-length MYSQL-FIELD-POINTER)"
    314             (p
    315               "Returns " (code "unsigned-integer") ".") )
    316 
    317           (procedure "(mysql-field-catalog-length MYSQL-FIELD-POINTER)"
    318             (p
    319               "Returns " (code "unsigned-integer") ".") )
    320 
    321           (procedure "(mysql-field-db-length MYSQL-FIELD-POINTER)"
    322             (p
    323               "Returns " (code "unsigned-integer") ".") )
    324 
    325           (procedure "(mysql-field-org-table-length MYSQL-FIELD-POINTER)"
    326             (p
    327               "Returns " (code "unsigned-integer") ".") )
    328 
    329           (procedure "(mysql-field-table-length MYSQL-FIELD-POINTER)"
    330             (p
    331               "Returns " (code "unsigned-integer") ".") )
    332 
    333           (procedure "(mysql-field-org-name-length MYSQL-FIELD-POINTER)"
    334             (p
    335               "Returns " (code "unsigned-integer") ".") )
    336 
    337           (procedure "(mysql-field-name-length MYSQL-FIELD-POINTER)"
    338             (p
    339               "Returns " (code "unsigned-integer") ".") )
    340 
    341           (procedure "(mysql-field-max-length MYSQL-FIELD-POINTER)"
    342             (p
    343               "Returns " (code "unsigned-integer") ".") )
    344 
    345           (procedure "(mysql-field-length MYSQL-FIELD-POINTER)"
    346             (p
    347               "Returns " (code "unsigned-integer") ".") )
     440      )
     441
     442      (subsection "Character Set Access"
     443
     444        (procedure "(mysql-set-character-set CONN CHARACTER-SET-NAME)"
     445          (p
     446            "Sets the current character set.") )
     447
     448        (procedure "(mysql-character-set-name CONN)"
     449          (p
     450            "Returns a " (tt "string") ".") )
     451
     452        (procedure "(mysql-get-character-set-info CONN)"
     453          (p
     454            "Returns a " (tt "MY-CHARSET-INFO-POINTER") ".") )
     455
     456        (subsubsection "Slot Getters"
     457
     458          (procedure "(my-charset-info-name MY-CHARSET-INFO-POINTER)"
     459            (p
     460              "Return a " (code "string") ".") )
     461
     462          (procedure "(my-charset-info-csname MY-CHARSET-INFO-POINTER)"
     463            (p
     464              "Return a " (code "string") ".") )
     465
     466          (procedure "(my-charset-info-comment MY-CHARSET-INFO-POINTER)"
     467            (p
     468              "Return a " (code "string") ".") )
     469
     470          (procedure "(my-charset-info-dir MY-CHARSET-INFO-POINTER)"
     471            (p
     472              "Return a " (code "string") ".") )
     473
     474          (procedure "(my-charset-info-mbminlen MY-CHARSET-INFO-POINTER)"
     475            (p
     476              "Return a " (code "number") ".") )
     477
     478          (procedure "(my-charset-info-mbmaxlen MY-CHARSET-INFO-POINTER)"
     479            (p
     480              "Return a " (code "number") ".") )
    348481        )
    349482      )
    350483
    351       (subsection "Enumeration Values"
    352 
    353         (symbol-table "enum enum_mysql_set_option"
    354           (describe mysql-option-multi-statements-on "MYSQL_OPTION_MULTI_STATEMENTS_ON")
    355           (describe mysql-option-multi-statements-off "MYSQL_OPTION_MULTI_STATEMENTS_OFF") )
    356 
    357         (symbol-table "enum mysql_option"
    358           (describe mysql-opt-connect-timeout "MYSQL_OPT_CONNECT_TIMEOUT")
    359           (describe mysql-opt-compress "MYSQL_OPT_COMPRESS")
    360           (describe mysql-opt-named-pipe "MYSQL_OPT_NAMED_PIPE")
    361           (describe mysql-init-command "MYSQL_INIT_COMMAND")
    362           (describe mysql-read-default-file "MYSQL_READ_DEFAULT_FILE")
    363           (describe mysql-read-default-group "MYSQL_READ_DEFAULT_GROUP")
    364           (describe mysql-set-charset-dir "MYSQL_SET_CHARSET_DIR")
    365           (describe mysql-set-charset-name "MYSQL_SET_CHARSET_NAME")
    366           (describe mysql-opt-local-infile "MYSQL_OPT_LOCAL_INFILE")
    367           (describe mysql-opt-protocol "MYSQL_OPT_PROTOCOL")
    368           (describe mysql-shared-memory-base-name "MYSQL_SHARED_MEMORY_BASE_NAME")
    369           (describe mysql-opt-read-timeout "MYSQL_OPT_READ_TIMEOUT")
    370           (describe mysql-opt-write-timeout "MYSQL_OPT_WRITE_TIMEOUT")
    371           (describe mysql-opt-use-result "MYSQL_OPT_USE_RESULT")
    372           (describe mysql-opt-use-remote-connection "MYSQL_OPT_USE_REMOTE_CONNECTION")
    373           (describe mysql-opt-use-embedded-connection "MYSQL_OPT_USE_EMBEDDED_CONNECTION")
    374           (describe mysql-opt-guess-connection "MYSQL_OPT_GUESS_CONNECTION")
    375           (describe mysql-set-client-ip "MYSQL_SET_CLIENT_IP")
    376           (describe mysql-secure-auth "MYSQL_SECURE_AUTH")
    377           (describe mysql-report-data-truncation "MYSQL_REPORT_DATA_TRUNCATION") )
    378 
    379         (symbol-table "enum enum_field_types"
    380           (describe mysql-type-decimal "MYSQL_TYPE_DECIMAL")
    381           (describe mysql-type-tiny "MYSQL_TYPE_TINY")
    382           (describe mysql-type-short "MYSQL_TYPE_SHORT")
    383           (describe mysql-type-long "MYSQL_TYPE_LONG")
    384           (describe mysql-type-float "MYSQL_TYPE_FLOAT")
    385           (describe mysql-type-double "MYSQL_TYPE_DOUBLE")
    386           (describe mysql-type-null "MYSQL_TYPE_NULL")
    387           (describe mysql-type-timestamp "MYSQL_TYPE_TIMESTAMP")
    388           (describe mysql-type-longlong "MYSQL_TYPE_LONGLONG")
    389           (describe mysql-type-int24 "MYSQL_TYPE_INT24")
    390           (describe mysql-type-date "MYSQL_TYPE_DATE")
    391           (describe mysql-type-time "MYSQL_TYPE_TIME")
    392           (describe mysql-type-datetime "MYSQL_TYPE_DATETIME")
    393           (describe mysql-type-year "MYSQL_TYPE_YEAR")
    394           (describe mysql-type-newdate "MYSQL_TYPE_NEWDATE")
    395           (describe mysql-type-varchar "MYSQL_TYPE_VARCHAR")
    396           (describe mysql-type-bit "MYSQL_TYPE_BIT")
    397           (describe mysql-type-newdecimal "MYSQL_TYPE_NEWDECIMAL")
    398           (describe mysql-type-enum "MYSQL_TYPE_ENUM")
    399           (describe mysql-type-set "MYSQL_TYPE_SET")
    400           (describe mysql-type-tiny-blob "MYSQL_TYPE_TINY_BLOB")
    401           (describe mysql-type-medium-blob "MYSQL_TYPE_MEDIUM_BLOB")
    402           (describe mysql-type-long-blob "MYSQL_TYPE_LONG_BLOB")
    403           (describe mysql-type-blob "MYSQL_TYPE_BLOB")
    404           (describe mysql-type-var-string "MYSQL_TYPE_VAR_STRING")
    405           (describe mysql-type-string "MYSQL_TYPE_STRING")
    406           (describe mysql-type-geometry "MYSQL_TYPE_GEOMETRY") )
    407 
    408         (symbol-table "MYSQL_FIELD flags"
    409           (describe not-null-flag "NOT-NULL-FLAG")
    410           (describe pri-key-flag "PRI-KEY-FLAG")
    411           (describe unique-key-flag "UNIQUE-KEY-FLAG")
    412           (describe multiple-key-flag "MULTIPLE-KEY-FLAG")
    413           (describe unsigned-flag "UNSIGNED-FLAG")
    414           (describe zerofill-flag "ZEROFILL-FLAG")
    415           (describe binary-flag "BINARY-FLAG")
    416           (describe auto-increment-flag "AUTO-INCREMENT-FLAG")
    417           (describe no-default-value-flag "NO-DEFAULT-VALUE-FLAG") )
     484      (subsection "Miscellaneous Procedures"
     485
     486        (procedure "(mysql-change-user CONN [KEYWORD ...])
     487          (p
     488            "Changes the user identity.")
     489          (p
     490            "Any number of the following " (tt "KEYWORD ...") " may be included:"
     491            (ul
     492              (li (tt "user"))
     493              (li (tt "passwd"))
     494              (li (tt "db")))) )
     495
     496        (procedure "(mysql-debug debug)
     497          (p
     498            ".") )
     499
     500        (procedure "(mysql-dump-debug-info CONN)
     501          (p
     502            ".") )
     503
     504        (procedure "(mysql-errno CONN)
     505          (p
     506            ".") )
     507
     508        (procedure "(mysql-error CONN)
     509          (p
     510            "Returns a string describing the last mysql error, or #f if no error has occurred.") )
     511
     512        (procedure "(mysql-escape-string CONN SQL)
     513          (p
     514            "Returns an escape encoded form of the " (tt "SQL") " string.") )
     515
     516        (procedure "(mysql-free-result CONN)
     517          (p
     518            ".") )
     519
     520        (procedure "(mysql-get-client-info)
     521          (p
     522            ".") )
     523
     524        (procedure "(mysql-get-client-version)
     525          (p
     526            ".") )
     527
     528        (procedure "(mysql-get-host-info CONN)
     529          (p
     530            ".") )
     531
     532        (procedure "(mysql-get-proto-info CONN)
     533          (p
     534            ".") )
     535
     536        (procedure "(mysql-get-server-info CONN)
     537          (p
     538            ".") )
     539
     540        (procedure "(mysql-get-server-version CONN)
     541          (p
     542            ".") )
     543
     544        (procedure "(mysql-info CONN)
     545          (p
     546            ".") )
     547
     548        (procedure "(mysql-insert-id CONN)
     549          (p
     550            ".") )
     551
     552        (procedure "(mysql-kill CONN PID)
     553          (p
     554            ".") )
     555
     556        (procedure "(mysql-list-dbs CONN LIKE)
     557          (p
     558            ".") )
     559
     560        (procedure "(mysql-list-fields CONN TABLE WILD)
     561          (p
     562            ".") )
     563
     564        (procedure "(mysql-list-processes CONN)
     565          (p
     566            ".") )
     567
     568        (procedure "(mysql-list-tables CONN WILD)
     569          (p
     570            ".") )
     571
     572        (procedure "(mysql-num-fields CONN)
     573          (p
     574            ".") )
     575
     576        (procedure "(mysql-num-rows CONN)
     577          (p
     578            ".") )
     579
     580        (procedure "(mysql-ping CONN)
     581          (p
     582            ".") )
     583
     584        (procedure "(mysql-select-db CONN DB)
     585          (p
     586            "Returns " (code "#t") " if the select was successful, "
     587            "signals exception otherwise.") )
     588
     589        (procedure "(mysql-stat CONN)
     590          (p
     591            ".") )
     592
     593        (procedure "(mysql-store-result CONN)
     594          (p
     595            ".") )
     596
     597        (procedure "(mysql-thread-id CONN)
     598          (p
     599            ".") )
     600      )
     601
     602      (subsection "Enumerations & Flags"
     603
     604        (subsubsection "Client Flags"
     605
     606          (symbol-table "Symbolic Value"
     607            (describe client-compress "CLIENT_COMPRESS")
     608            (describe client-found-rows "CLIENT_FOUND_ROWS")
     609            (describe client-ignore-sigpipe "CLIENT_IGNORE_SIGPIPE")
     610            (describe client-ignore-space "CLIENT_IGNORE_SPACE")
     611            (describe client-interactive "CLIENT_INTERACTIVE")
     612            (describe client-local-files "CLIENT_LOCAL_FILES")
     613            (describe client-multi-results "CLIENT_MULTI_RESULTS")
     614            (describe client-multi-statements "CLIENT_MULTI_STATEMENTS")
     615            (describe client-no-schema "CLIENT_NO_SCHEMA")
     616            (describe client-odbc "CLIENT_ODBC")
     617            (describe client-ssl "CLIENT_SSL") )
     618
     619          (procedure "(mysql-client-flags-value FLAG ...)"
     620            (p
     621              "Returns the or'ed value of the " (tt "FLAG ...") ".") )
     622
     623          (procedure "(mysql-client-flags-symbol NUMBER)"
     624            (p
     625              "Returns the symbol for the " (tt "NUMBER") ".") )
     626        )
     627
     628        (subsubsection "enum enum_mysql_set_option"
     629
     630          (symbol-table "Symbolic Value"
     631            (describe mysql-option-multi-statements-on "MYSQL_OPTION_MULTI_STATEMENTS_ON")
     632            (describe mysql-option-multi-statements-off "MYSQL_OPTION_MULTI_STATEMENTS_OFF") )
     633
     634          (procedure "(mysql-server-option-value FLAG ...)"
     635            (p
     636              "Returns the or'ed value of the " (tt "FLAG ...") ".") )
     637
     638          (procedure "(mysql-server-option-symbol NUMBER)"
     639            (p
     640              "Returns the symbol for the " (tt "NUMBER") ".") )
     641        )
     642
     643        (subsubsection "enum mysql_option"
     644
     645          (symbol-table "Symbolic Value"
     646            (describe mysql-opt-connect-timeout "MYSQL_OPT_CONNECT_TIMEOUT")
     647            (describe mysql-opt-compress "MYSQL_OPT_COMPRESS")
     648            (describe mysql-opt-named-pipe "MYSQL_OPT_NAMED_PIPE")
     649            (describe mysql-init-command "MYSQL_INIT_COMMAND")
     650            (describe mysql-read-default-file "MYSQL_READ_DEFAULT_FILE")
     651            (describe mysql-read-default-group "MYSQL_READ_DEFAULT_GROUP")
     652            (describe mysql-set-charset-dir "MYSQL_SET_CHARSET_DIR")
     653            (describe mysql-set-charset-name "MYSQL_SET_CHARSET_NAME")
     654            (describe mysql-opt-local-infile "MYSQL_OPT_LOCAL_INFILE")
     655            (describe mysql-opt-protocol "MYSQL_OPT_PROTOCOL")
     656            (describe mysql-shared-memory-base-name "MYSQL_SHARED_MEMORY_BASE_NAME")
     657            (describe mysql-opt-read-timeout "MYSQL_OPT_READ_TIMEOUT")
     658            (describe mysql-opt-write-timeout "MYSQL_OPT_WRITE_TIMEOUT")
     659            (describe mysql-opt-use-result "MYSQL_OPT_USE_RESULT")
     660            (describe mysql-opt-use-remote-connection "MYSQL_OPT_USE_REMOTE_CONNECTION")
     661            (describe mysql-opt-use-embedded-connection "MYSQL_OPT_USE_EMBEDDED_CONNECTION")
     662            (describe mysql-opt-guess-connection "MYSQL_OPT_GUESS_CONNECTION")
     663            (describe mysql-set-client-ip "MYSQL_SET_CLIENT_IP")
     664            (describe mysql-secure-auth "MYSQL_SECURE_AUTH")
     665            (describe mysql-report-data-truncation "MYSQL_REPORT_DATA_TRUNCATION") )
     666
     667          (procedure "(mysql-option-value FLAG ...)"
     668            (p
     669              "Returns the or'ed value of the " (tt "FLAG ...") ".") )
     670
     671          (procedure "(mysql-option-symbol NUMBER)"
     672            (p
     673              "Returns the symbol for the " (tt "NUMBER") ".") )
     674        )
     675
     676        (subsubsection "enum enum_field_types"
     677
     678          (symbol-table "Symbolic Value"
     679            (describe mysql-type-decimal "MYSQL_TYPE_DECIMAL")
     680            (describe mysql-type-tiny "MYSQL_TYPE_TINY")
     681            (describe mysql-type-short "MYSQL_TYPE_SHORT")
     682            (describe mysql-type-long "MYSQL_TYPE_LONG")
     683            (describe mysql-type-float "MYSQL_TYPE_FLOAT")
     684            (describe mysql-type-double "MYSQL_TYPE_DOUBLE")
     685            (describe mysql-type-null "MYSQL_TYPE_NULL")
     686            (describe mysql-type-timestamp "MYSQL_TYPE_TIMESTAMP")
     687            (describe mysql-type-longlong "MYSQL_TYPE_LONGLONG")
     688            (describe mysql-type-int24 "MYSQL_TYPE_INT24")
     689            (describe mysql-type-date "MYSQL_TYPE_DATE")
     690            (describe mysql-type-time "MYSQL_TYPE_TIME")
     691            (describe mysql-type-datetime "MYSQL_TYPE_DATETIME")
     692            (describe mysql-type-year "MYSQL_TYPE_YEAR")
     693            (describe mysql-type-newdate "MYSQL_TYPE_NEWDATE")
     694            (describe mysql-type-varchar "MYSQL_TYPE_VARCHAR")
     695            (describe mysql-type-bit "MYSQL_TYPE_BIT")
     696            (describe mysql-type-newdecimal "MYSQL_TYPE_NEWDECIMAL")
     697            (describe mysql-type-enum "MYSQL_TYPE_ENUM")
     698            (describe mysql-type-set "MYSQL_TYPE_SET")
     699            (describe mysql-type-tiny-blob "MYSQL_TYPE_TINY_BLOB")
     700            (describe mysql-type-medium-blob "MYSQL_TYPE_MEDIUM_BLOB")
     701            (describe mysql-type-long-blob "MYSQL_TYPE_LONG_BLOB")
     702            (describe mysql-type-blob "MYSQL_TYPE_BLOB")
     703            (describe mysql-type-var-string "MYSQL_TYPE_VAR_STRING")
     704            (describe mysql-type-string "MYSQL_TYPE_STRING")
     705            (describe mysql-type-geometry "MYSQL_TYPE_GEOMETRY") )
     706
     707          (procedure "(mysql-type-value FLAG ...)"
     708            (p
     709              "Returns the or'ed value of the " (tt "FLAG ...") ".") )
     710
     711          (procedure "(mysql-type-symbol NUMBER)"
     712            (p
     713              "Returns the symbol for the " (tt "NUMBER") ".") )
     714        )
     715
     716        (subsubsection "MYSQL_FIELD.flags Flags"
     717
     718          (symbol-table "Symbolic Value"
     719            (describe not-null-flag "NOT-NULL-FLAG")
     720            (describe pri-key-flag "PRI-KEY-FLAG")
     721            (describe unique-key-flag "UNIQUE-KEY-FLAG")
     722            (describe multiple-key-flag "MULTIPLE-KEY-FLAG")
     723            (describe unsigned-flag "UNSIGNED-FLAG")
     724            (describe zerofill-flag "ZEROFILL-FLAG")
     725            (describe binary-flag "BINARY-FLAG")
     726            (describe auto-increment-flag "AUTO-INCREMENT-FLAG")
     727            (describe no-default-value-flag "NO-DEFAULT-VALUE-FLAG") )
     728
     729          (procedure "(mysql-field-flags-value FLAG ...)"
     730            (p
     731              "Returns the or'ed value of the " (tt "FLAG ...") ".") )
     732
     733          (procedure "(mysql-field-flags-symbol NUMBER)"
     734            (p
     735              "Returns the symbol for the " (tt "NUMBER") ".") )
     736        )
    418737      )
    419738    ) ; documentation
  • release/3/mysql/trunk/mysql-tests-body.scm

    r7926 r7930  
    44
    55(use mysql)
     6
     7;;;
    68
    79(define (collect-until proc pred)
     
    1315  (collect-until proc (complement pred)) )
    1416
    15 (define (mysql-fetch-field-items conn . getters)
    16   (collect-while (lambda () (apply mysql-fetch-field-slots conn getters)) identity) )
     17;;;
    1718
    1819(define (mysql-fetch-field-item conn getter)
    1920  (collect-while (lambda () (mysql-fetch-field-slot conn getter)) identity) )
    2021
     22#; ;UNUSED
     23(define (mysql-fetch-field-items conn . getters)
     24  (collect-while (lambda () (apply mysql-fetch-field-slots conn getters)) identity) )
     25
     26;;;
     27
    2128(print "Opening the connection")
    22 (define *db* (mysql-connect user: *user* passwd: *passwd* host: *host*))
    23 (print "Database: " *db*)
     29(define *conn* (mysql-connect user: *user* passwd: *passwd* host: *host*))
     30(print "Database: " *conn*)
    2431
    25 (unless *db*
     32(unless *conn*
    2633  (print "Unable to connect to database.")
    2734  (print "You might want to edit \"mysql-tests.scm\" to set *user*, *passwd*, and *host*.")
    2835  (exit) )
    2936
    30 (print "MySQL errno: " (mysql-errno *db*))
    31 (print "MySQL error: " (mysql-error *db*))
     37(print "MySQL errno: " (mysql-errno *conn*))
     38(print "MySQL error: " (mysql-error *conn*))
    3239(newline)
    3340
    34 (define (mysql-print-and-query *db* query)
     41(define (mysql-print-and-query *conn* query)
    3542  (print "QUERY: " query)
    36   (mysql-query *db* query))
     43  (mysql-query *conn* query))
    3744
    3845(print "Performing query: SHOW DATABASES")
    39 (mysql-print-and-query *db* "SHOW DATABASES")
    40 (print "Number of rows: " (mysql-num-rows *db*))
     46(mysql-print-and-query *conn* "SHOW DATABASES")
     47(print "Number of rows: " (mysql-num-rows *conn*))
    4148
    4249(newline)
    4350(print "The rows can be enumerated one-per-line, like this:")
    44 (mysql-foreach-row *db* (lambda (row row-idx)
     51(mysql-foreach-row *conn* (lambda (row row-idx)
    4552  (display (conc row-idx ": " (row "Database") "\n"))))
    4653
    4754(newline)
    4855(display "Or they can just be comma-separated, like so:")
    49 (mysql-foreach-row *db* (lambda (row row-idx)
     56(mysql-foreach-row *conn* (lambda (row row-idx)
    5057  (display (conc (row "Database")
    51                  (if (< row-idx (mysql-num-rows *db*)) ", " "\n")))))
     58                 (if (< row-idx (mysql-num-rows *conn*)) ", " "\n")))))
    5259
    53 (mysql-print-and-query *db* "DROP DATABASE IF EXISTS mysql_egg_test")
     60(mysql-print-and-query *conn* "DROP DATABASE IF EXISTS mysql_egg_test")
    5461
    55 (mysql-print-and-query *db* "CREATE DATABASE mysql_egg_test")
     62(mysql-print-and-query *conn* "CREATE DATABASE mysql_egg_test")
    5663
    5764(print "selecting database: mysql_egg_test")
    58 (mysql-select-db *db* "mysql_egg_test")
     65(mysql-select-db *conn* "mysql_egg_test")
    5966
    6067(newline)
    61 (mysql-print-and-query *db* "CREATE TABLE test1 (
     68(mysql-print-and-query *conn* "CREATE TABLE test1 (
    6269  id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    6370  testboolnn BOOLEAN NOT NULL,
     
    6673
    6774(newline)
    68 (mysql-print-and-query *db*
     75(mysql-print-and-query *conn*
    6976  "INSERT INTO test1 SET testboolnn=TRUE, testbool=NULL")
    70 (mysql-print-and-query *db*
     77(mysql-print-and-query *conn*
    7178  "INSERT INTO test1 SET testboolnn=FALSE, testbool=FALSE")
    7279
    7380(newline)
    74 (mysql-print-and-query *db* "SELECT testboolnn, testbool FROM test1")
    75 (mysql-foreach-row *db* (lambda (row idx)
     81(mysql-print-and-query *conn* "SELECT testboolnn, testbool FROM test1")
     82(mysql-foreach-row *conn* (lambda (row idx)
    7683  (display (conc "row " idx ": testboolnn=" (row "testboolnn")
    7784                 ", testbool="
     
    7986
    8087(newline)
    81 (mysql-print-and-query *db* "SELECT testboolnn, testbool FROM test1")
    82 (let ([names (mysql-fetch-field-item *db* mysql-field-name)])
     88(mysql-print-and-query *conn* "SELECT testboolnn, testbool FROM test1")
     89(let ([names (mysql-fetch-field-item *conn* mysql-field-name)])
    8390  (pretty-print
    8491   (mysql-row-map
    85      *db*
     92     *conn*
    8693     (lambda (row idx)
    8794       (map (lambda (f) (cons f (row f))) names)))) )
    8895
    8996(newline)
    90 (mysql-print-and-query *db* "SELECT testboolnn, testbool FROM test1")
     97(mysql-print-and-query *conn* "SELECT testboolnn, testbool FROM test1")
    9198(mysql-row-for-each
    92   *db*
     99  *conn*
    93100  (lambda (row idx)
    94     (print "Row " idx " lengths: " (mysql-fetch-lengths *db*))))
     101    (print "Row " idx " lengths: " (mysql-fetch-lengths *conn*))))
    95102
    96103;; Finished
    97104(newline)
    98105(print "Closing the connection")
    99 (mysql-close *db*)
     106(mysql-close *conn*)
  • release/3/mysql/trunk/mysql.meta

    r2988 r7930  
    66 (category db)
    77 (egg "mysql.egg")
    8  (files "mysql.setup" "mysql.scm" "mysqlaux.c" "mysqlaux.h"))
     8 (files "mysql.setup"
     9        "mysql.scm"
     10        "mysql.html" "mysql-mole.html"
     11        "mysql-tests-body.scm") )
  • release/3/mysql/trunk/mysql.scm

    r7926 r7930  
    7676#>
    7777#include <mysql.h>
    78 #include "mysqlaux.h"
    7978<#
    8079
     
    252251                #;mysql-next-result ; omitted (too new)
    253252
     253    ;;
     254    make-mysql-options
     255
    254256    ;; ssl parameters api
    255257    make-mysql-ssl
     
    439441;-----------------------------------------------------------------------
    440442; Private enumeration value constants
     443;
    441444
    442445(define-foreign-enum (mysql-server-option (enum "enum_mysql_set_option"))
     
    557560;-----------------------------------------------------------------------
    558561; Public enumeration value constants
     562;
    559563
    560564(define-macro (gen-public-enum ?typ . ?syms)
     
    656660
    657661;-----------------------------------------------------------------------
    658 ; Struct API
     662; MySQL C Structures API
     663;
    659664
    660665(define-foreign-record (mysql-field "MYSQL_FIELD")
     
    700705; "double" in the C interface, converting to "my_ulonglong"
    701706; to/from the MySQL API.
     707;
    702708
    703709#>
     
    11201126;
    11211127
     1128#>
     1129/*
     1130 * Returns NULL if the idx is out of bounds; the string value of the requested
     1131 * field, otherwise.
     1132 */
     1133static char *mysqlaux_column_idx(MYSQL *mysql, MYSQL_RES *result, MYSQL_ROW row,
     1134                                                                unsigned int idx)
     1135{
     1136  if (idx >= 0 && mysql_num_fields(result) > idx) {
     1137    return (char*)row[idx];
     1138  } else {
     1139    return NULL;
     1140  }
     1141}
     1142
     1143/*
     1144 * Returns NULL if the name doesn't exist as a column name in the result
     1145 * set (case insensitive comparison). Otherwise, the string value of the
     1146 * resquested field is returned.
     1147 *
     1148 * (According to
     1149 *    http://dev.mysql.com/doc/mysql/en/name-case-sensitivity.html
     1150 * column names are never case sensitive.)
     1151 */
     1152static char *mysqlaux_column_name(MYSQL *mysql, MYSQL_RES *result, MYSQL_ROW row,
     1153                                                                const char *name)
     1154{
     1155  unsigned int num_fields;
     1156  unsigned int i;
     1157  MYSQL_FIELD *fields;
     1158
     1159  num_fields = mysql_field_count(mysql);
     1160  fields = mysql_fetch_fields(result);
     1161
     1162  for(i = 0; i < num_fields; i++) {
     1163    if (strcasecmp(name, fields[i].name) == 0) {
     1164      return row[i];
     1165    }
     1166  }
     1167
     1168  return NULL;
     1169}
     1170<#
     1171
    11221172; char *mysqlaux_column_idx(MYSQL *, MYSQL_RES *, MYSQL_ROW, unsigned int);
    11231173(define foreign-mysqlaux-column-idx
     
    11441194;-----------------------------------------------------------------------
    11451195; MySQL exceptions
     1196;
    11461197
    11471198(define (make-exn-condition loc msg . args)
     
    11671218; See <http://www.openssl.org/docs/apps/ciphers.html> for a discussion
    11681219; of the cipher-list format.
     1220;
    11691221
    11701222(define-record-type mysql-ssl
     
    11971249      ">")
    11981250     out) ) )
     1251
     1252;-----------------------------------------------------------------------
     1253; MySQL connection options helper.
     1254;
     1255
     1256(define (make-mysql-options . opts)
     1257  (let loop ([opts opts] [alst '()])
     1258    (if (null? opts)
     1259        alst
     1260        (let* ([opt (car opts)]
     1261               [nxt (cdr opts)]
     1262               [val (if (null? nxt)
     1263                        (error 'make-options "missing value for option" opt)
     1264                        (car nxt))])
     1265          (unless (number? opt)
     1266            (error 'make-options "invalid option" opt) )
     1267          (unless (or (number? val) (string? val) (not val) (null? val))
     1268            (error 'make-options "invalid option value" val) )
     1269          (loop (cdr nxt) (alist-cons opt val alst)) ) ) ) )
    11991270
    12001271;-----------------------------------------------------------------------
     
    14271498  (foreign-mysql-get-host-info (mysql-connection-ptr conn)) )
    14281499
    1429 ;
    14301500(define (mysql-get-proto-info conn)
    14311501  (foreign-mysql-get-proto-info (mysql-connection-ptr conn)) )
     
    16011671;-----------------------------------------------------------------------
    16021672; The MySQL Field structure multi-slot API.
     1673;
    16031674
    16041675; returns a list of field items.
  • release/3/mysql/trunk/mysql.setup

    r7925 r7930  
    2121        ,@(if has-exports? '(-check-imports -emit-exports mysql.exports) '())
    2222  ,mysql-header-search-option -lmysqlclient -lz
    23   mysqlaux.c mysql.scm)
     23  mysql.scm)
    2424
    2525(install-extension 'mysql
Note: See TracChangeset for help on using the changeset viewer.