projects
/
clsql.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r9430: correctly obtain server and client versions of oracle.
[clsql.git]
/
db-postgresql-socket
/
postgresql-socket-sql.lisp
diff --git
a/db-postgresql-socket/postgresql-socket-sql.lisp
b/db-postgresql-socket/postgresql-socket-sql.lisp
index a0a534aa0392ba8f65fda49fdc261c6a3f31b290..0bfc01b5a025796d259c92fc52b17dbc8490b080 100644
(file)
--- a/
db-postgresql-socket/postgresql-socket-sql.lisp
+++ b/
db-postgresql-socket/postgresql-socket-sql.lisp
@@
-106,10
+106,10
@@
doesn't depend on UFFI."
(defun convert-to-clsql-warning (database condition)
(ecase *backend-warning-behavior*
(:warn
(defun convert-to-clsql-warning (database condition)
(ecase *backend-warning-behavior*
(:warn
- (warn '
cl
sql-database-warning :database database
+ (warn 'sql-database-warning :database database
:message (postgresql-condition-message condition)))
(:error
:message (postgresql-condition-message condition)))
(:error
- (error '
clsql-sql
-error :database database
+ (error '
sql-database
-error :database database
:message (format nil "Warning upgraded to error: ~A"
(postgresql-condition-message condition))))
((:ignore nil)
:message (format nil "Warning upgraded to error: ~A"
(postgresql-condition-message condition))))
((:ignore nil)
@@
-117,10
+117,11
@@
doesn't depend on UFFI."
)))
(defun convert-to-clsql-error (database expression condition)
)))
(defun convert-to-clsql-error (database expression condition)
- (error 'clsql-sql-error :database database
+ (error 'sql-database-data-error
+ :database database
:expression expression
:expression expression
- :err
no
(type-of condition)
- :
error
(postgresql-condition-message condition)))
+ :err
or-id
(type-of condition)
+ :
message
(postgresql-condition-message condition)))
(defmacro with-postgresql-handlers
((database &optional expression)
(defmacro with-postgresql-handlers
((database &optional expression)
@@
-191,11
+192,11
@@
doesn't depend on UFFI."
:password password))
(postgresql-error (c)
;; Connect failed
:password password))
(postgresql-error (c)
;; Connect failed
- (error '
clsql-connect
-error
+ (error '
sql-connection
-error
:database-type database-type
:connection-spec connection-spec
:database-type database-type
:connection-spec connection-spec
- :err
no
(type-of c)
- :
error
(postgresql-condition-message c)))
+ :err
or-id
(type-of c)
+ :
message
(postgresql-condition-message c)))
(:no-error (connection)
;; Success, make instance
(make-instance 'postgresql-socket-database
(:no-error (connection)
;; Success, make instance
(make-instance 'postgresql-socket-database
@@
-217,11
+218,11
@@
doesn't depend on UFFI."
(wait-for-query-results connection)
(unless (eq status :cursor)
(close-postgresql-connection connection)
(wait-for-query-results connection)
(unless (eq status :cursor)
(close-postgresql-connection connection)
- (error '
clsql-sql
-error
+ (error '
sql-database-data
-error
:database database
:expression expression
:database database
:expression expression
- :err
no 'missing-result
- :
error
"Didn't receive result cursor for query."))
+ :err
or-id "missing-result"
+ :
message
"Didn't receive result cursor for query."))
(setq result-types (canonicalize-types result-types cursor))
(values
(loop for row = (read-cursor-row cursor result-types)
(setq result-types (canonicalize-types result-types cursor))
(values
(loop for row = (read-cursor-row cursor result-types)
@@
-230,11
+231,11
@@
doesn't depend on UFFI."
finally
(unless (null (wait-for-query-results connection))
(close-postgresql-connection connection)
finally
(unless (null (wait-for-query-results connection))
(close-postgresql-connection connection)
- (error '
clsql-sql
-error
+ (error '
sql-database-data
-error
:database database
:expression expression
:database database
:expression expression
- :err
no 'multiple-results
- :
error
"Received multiple results for query.")))
+ :err
or-id "multiple-results"
+ :
message
"Received multiple results for query.")))
(when field-names
(mapcar #'car (postgresql-cursor-fields cursor))))))))
(when field-names
(mapcar #'car (postgresql-cursor-fields cursor))))))))
@@
-258,19
+259,19
@@
doesn't depend on UFFI."
((eq status :completed)
(unless (null (wait-for-query-results connection))
(close-postgresql-connection connection)
((eq status :completed)
(unless (null (wait-for-query-results connection))
(close-postgresql-connection connection)
- (error '
clsql-sql
-error
+ (error '
sql-database-data
-error
:database database
:expression expression
:database database
:expression expression
- :err
no 'multiple-results
- :
error
"Received multiple results for command."))
+ :err
or-id "multiple-results"
+ :
message
"Received multiple results for command."))
result)
(t
(close-postgresql-connection connection)
result)
(t
(close-postgresql-connection connection)
- (error '
clsql-sql
-error
+ (error '
sql-database-data
-error
:database database
:expression expression
:database database
:expression expression
- :errno
'missing-result
- :
error
"Didn't receive completion for command.")))))))
+ :errno
"missing-result"
+ :
message
"Didn't receive completion for command.")))))))
(defstruct postgresql-socket-result-set
(done nil)
(defstruct postgresql-socket-result-set
(done nil)
@@
-288,11
+289,11
@@
doesn't depend on UFFI."
(wait-for-query-results connection)
(unless (eq status :cursor)
(close-postgresql-connection connection)
(wait-for-query-results connection)
(unless (eq status :cursor)
(close-postgresql-connection connection)
- (error '
clsql-sql
-error
+ (error '
sql-database-data
-error
:database database
:expression expression
:database database
:expression expression
- :err
no 'missing-result
- :
error
"Didn't receive result cursor for query."))
+ :err
or-id "missing-result"
+ :
message
"Didn't receive result cursor for query."))
(values (make-postgresql-socket-result-set
:done nil
:cursor cursor
(values (make-postgresql-socket-result-set
:done nil
:cursor cursor