diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f583e7..e9bc4b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,30 @@ +# Changelog v. 1.32.9 +Adds new utility functions + +- table-description-menu which allows you to pick and choose +what table characteristics you want returned. See giant docstring for details. + +- get-schema-comment which takes a schema name and returns the schema comment +as a string + +- list-check-constraints which takes a fully qualified table name and returns +a list of lists of check constraints where each sublist has the form +of (check-constraint-name check). + +Example: (list-check-constraints "s2.employees") +(("employees_birth_date_check" "CHECK (birth_date > '1900-01-01'::date)") + ("employees_check" "CHECK (start_date > birth_date)") + ("employees_salary_check" "CHECK (salary > 0::numeric)")) + +Now exports +get-column-comments (the parameter string has changed if you were using the internal version) +get-all-table-comments + +Bug Fixes: + +Fixes a bug when trying to connect to a database using ssl. If the keyword :try was used, +the connection would not fall back to non-ssl connections. + # Changelog v. 1.32.8 S-SQL Enhancements diff --git a/ROADMAP.md b/ROADMAP.md index 1103e18..1d5cb3c 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -49,10 +49,6 @@ No guarantee is given with respect to resolution or timing on any item. - [ ] Named Prepared Statement explicit arglist - [ ] SQL Read Table Review (comments requested on any work that should be done here) - [ ] Row Reader Review (comments requested on any work that should be done here) -- [ ] Prepared Query Review (comments requested on any work that should be done here) -- [ ] Reading large bytea column over ssl connection errors have been reported. Postgresql does not - have a chunk API so the network is handling the content as a whole. -- [ ] Alter system (postgresql 9.4) - [ ] Allow parameters to be passed as binary to postgresql ## Connections/Reconnections and Transactions diff --git a/cl-postgres/protocol.lisp b/cl-postgres/protocol.lisp index b2baf36..19b090b 100644 --- a/cl-postgres/protocol.lisp +++ b/cl-postgres/protocol.lisp @@ -184,7 +184,7 @@ be matched against it." (setf socket (funcall make-ssl-stream socket :key *ssl-key-file* :certificate *ssl-certificate-file* - :verify (if verify + :verify (if verify :required nil) :hostname hostname))) @@ -208,9 +208,14 @@ a condition." (client-initial-response nil) (expected-server-signature nil)) (unless (eq use-ssl :no) - (setf socket (initiate-ssl socket (member use-ssl '(:require :yes :full)) - (member use-ssl '(:yes :full)) - (if (eq use-ssl :full) hostname)))) + (if (eq use-ssl :try) + (let ((old-socket socket) + (new-socket (initiate-ssl socket nil nil nil))) + (if new-socket (setf socket new-socket) + (setf socket old-socket))) + (setf socket (initiate-ssl socket (member use-ssl '(:require :yes :full)) + (member use-ssl '(:yes :full)) + (if (eq use-ssl :full) hostname))))) (startup-message socket user database) (force-output socket) (labels ((init-gss-msg (in-buffer) @@ -271,34 +276,27 @@ CL-GSS package is loaded.")) (ecase type (0 (return)) (2 (error 'database-error - :message "Unsupported Kerberos -authentication requested.")) + :message "Unsupported Kerberos authentication requested.")) (3 (unless password - (error "Server requested plain-password -authentication, but no password was given.")) + (error "Server requested plain-password authentication, but no password was given.")) (plain-password-message socket password) (force-output socket)) (4 (error 'database-error - :message "Unsupported crypt -authentication requested.")) + :message "Unsupported crypt authentication requested.")) (5 (unless password - (error "Server requested md5-password -authentication, but no password was given.")) + (error "Server requested md5-password authentication, but no password was given.")) (md5-password-message socket password user (read-bytes socket 4)) (force-output socket)) (6 (error 'database-error - :message "Unsupported SCM -authentication requested.")) + :message "Unsupported SCM authentication requested.")) (7 (when gss-context (error 'database-error - :message "Got GSS init message when -a context was already established")) + :message "Got GSS init message when a context was already established")) (init-gss-msg nil)) (8 (unless gss-context (error 'database-error - :message "Got GSS continuation -message without a context")) + :message "Got GSS continuation message without a context")) (init-gss-msg (read-bytes socket (- size 4)))) (9 ) ; auth_required_sspi or auth_req_sspi sspi ;negotiate without wrap() see postgresql diff --git a/doc/postmodern.html b/doc/postmodern.html index 24925fc..21d3ce8 100644 --- a/doc/postmodern.html +++ b/doc/postmodern.html @@ -1,7 +1,7 @@
- +Representation of a database connection. Contains login information in order to @@ -574,8 +579,8 @@
→ database-connection @@ -602,8 +607,8 @@
The default for connect's use-ssl argument. @@ -617,8 +622,8 @@
Disconnects a normal database connection, or moves a pooled connection into the @@ -627,8 +632,8 @@
→ boolean @@ -641,8 +646,8 @@
Reconnect a disconnected database connection. This is not allowed for pooled @@ -652,8 +657,8 @@
Special variable holding the current database connection information. Most @@ -663,8 +668,8 @@
Evaluates the body with database bound to a connection as specified by spec, @@ -673,8 +678,8 @@
The functional backend to with-connection. Binds database to a new connection @@ -685,8 +690,8 @@
Bind the database to a new connection. Use this if you only need one @@ -695,8 +700,8 @@
Disconnect the database. @@ -704,8 +709,8 @@
Disconnect and remove all connections from the connection pools. @@ -713,8 +718,8 @@
Set the maximum amount of connections kept in a single connection pool, where a @@ -724,8 +729,8 @@
→ list @@ -738,12 +743,12 @@
→ result @@ -863,9 +868,9 @@
The default is :lists
@@ -876,9 +881,9 @@Returns a single field. Will throw an error if the queries returns more than one field or more than one row
@@ -889,9 +894,9 @@Returns a list containing the selected fields. Will throw an error if the query returns more than one row
@@ -902,9 +907,9 @@This is the default
@@ -915,9 +920,9 @@Returns an alist containing the field name as a keyword and the selected fields. Will throw an error if the query returns more than one row.
@@ -928,9 +933,9 @@Returns an alist containing the field name as a lower case string and the selected fields. Will throw an error if the query returns more than one row.
@@ -942,9 +947,9 @@Returns a list of alists containing the field name as a keyword and the selected fields.
@@ -956,9 +961,9 @@Returns a list of alists containing the field name as a lower case string and the selected fields.
@@ -970,9 +975,9 @@Returns a plist containing the field name as a keyword and the selected fields. Will throw an error if the query returns more than one row.
@@ -983,9 +988,9 @@Returns a list of plists containing the field name as a keyword and the selected fields.
@@ -996,9 +1001,9 @@Returns a vector of hashtables where each hash table is a returned row from the query with field name as the key expressed as a lower case string.
@@ -1016,9 +1021,9 @@Returns a list of daos of the type specified
@@ -1032,9 +1037,9 @@Returns a list of field values of a single field. Will throw an error if more than one field is selected
@@ -1048,9 +1053,9 @@Return a list of strings where the row returned is a json object expressed as a string
@@ -1088,9 +1093,9 @@Return a single string where the row returned is a json object expressed as a string
@@ -1105,9 +1110,9 @@Return a string containing a json array, each element in the array is a selected row expressed as a json object
@@ -1121,9 +1126,9 @@If the database returns information about the amount rows that were affected, such as with updating or deleting queries, this is returned as a second value. @@ -1132,8 +1137,8 @@
Execute a query, ignore the results. So, in effect, Like a query called with @@ -1144,8 +1149,8 @@
Execute the given query (a string or a list starting with a keyword), iterating @@ -1165,8 +1170,8 @@
→ function @@ -1203,8 +1208,8 @@
→ function @@ -1218,8 +1223,8 @@
Like defprepared, but allows to specify names of the function arguments in a @@ -1237,8 +1242,8 @@
Execute the given body within a database transaction, committing it when the @@ -1292,8 +1297,8 @@
Immediately commit an open transaction. @@ -1301,8 +1306,8 @@
Roll back the given transaction, but the transaction @@ -1316,9 +1321,9 @@
Roll back the given transaction, but the transaction block is still active. Thus calling abort-transaction in the middle of a @@ -1329,8 +1334,8 @@
Can only be used within a transaction. Establishes a savepoint with the given @@ -1389,8 +1394,8 @@
Immediately release a savepoint, commiting its results. @@ -1398,8 +1403,8 @@
Immediately roll back a savepoint, aborting the results. @@ -1407,8 +1412,8 @@
An accessor for the transaction or savepoint's list of commit hooks, each of @@ -1418,8 +1423,8 @@
An accessor for the transaction or savepoint's list of abort hooks, each of @@ -1431,8 +1436,8 @@
The transaction isolation level currently in use. Defaults to :read-committed-rw @@ -1453,8 +1458,8 @@
Executes body within a with-transaction form if no transaction is currently @@ -1507,8 +1512,8 @@
Roll back the given logical transaction, regardless of whether it is an actual @@ -1517,8 +1522,8 @@
Commit the given logical transaction, regardless of whether it is an actual @@ -1527,8 +1532,8 @@
This is bound to the current transaction-handle or savepoint-handle instance @@ -1537,8 +1542,8 @@
Ensures that body is executed within a transaction, but does not begin a new @@ -1547,8 +1552,8 @@
Executes body within a with-transaction form if and only if no transaction is @@ -1559,13 +1564,13 @@
When set to t, ensured-prepared will overwrite prepared statements having the @@ -1575,8 +1580,8 @@
→ boolean @@ -1586,8 +1591,8 @@
→ list @@ -1601,8 +1606,8 @@
The statement name can be a string or quoted symbol. @@ -1634,8 +1639,8 @@
→ list @@ -1657,8 +1662,8 @@
→ string @@ -1671,8 +1676,8 @@
→ string @@ -1686,8 +1691,8 @@
→ restart @@ -1702,8 +1707,8 @@
→ integer @@ -1715,8 +1720,8 @@
→ integer @@ -1729,8 +1734,8 @@
Polite way of terminating a query at the database (as opposed to calling @@ -1740,8 +1745,8 @@
Less polite way of terminating at the database (as opposed to calling @@ -1750,13 +1755,13 @@
Postmodern contains a simple system for defining CLOS classes that represent @@ -1802,8 +1807,8 @@
You can work directly with the database or you can use a simple @@ -1987,8 +1992,8 @@
→ list @@ -2256,8 +2261,8 @@
→ list @@ -2278,9 +2283,9 @@
→ symbol
@@ -2292,8 +2297,8 @@→ boolean @@ -2307,8 +2312,8 @@
→ dao @@ -2321,9 +2326,9 @@
→ dao if there were unbound slots with default values, otherwise nil
@@ -2341,9 +2346,9 @@→ symbol
@@ -2356,8 +2361,8 @@Create an :around-method for make-dao. The body is executed in a lexical @@ -2369,8 +2374,8 @@