+2012-09-04 Russ Tyndall <russ@acceleration.net>
+ * sql/expressions.lisp - Try to respect the casing of symbols
+ where it seems intentional (ie: is not default). This should fix
+ a failing test case, and I think behaves more understandibly.
+
+ If you specify a casing '|Foo Bar| lets treat that a string "Foo Bar"
+ and output it escaped
+
2012-08-28 Ryan Davis <ryan@acceleration.net>
* db-sqlite3/sqlite3-api.lisp - allow pathnames in the connection
settings, so '("/db/my.sqlite") and '(#P"/db/my.sqlite") are
#\^ #\& #\* #\| #\( #\) #\- #\+ #\< #\>
#\{ #\}))))
+(defun special-cased-symbol-p (sym)
+ "Should the symbols case be preserved, or should we convert to default casing"
+ (let ((name (symbol-name sym)))
+ (case (readtable-case *readtable*)
+ (:upcase (not (string= (string-upcase name) name)))
+ (:downcase (not (string= (string-downcase name) name)))
+ (t t))))
+
(defun %make-database-identifier (inp &optional database)
"We want to quote an identifier if it came to us as a string or if it has special characters
in it."
(symbol
(let ((s (sql-escape inp)))
(if (and (not (eql '* inp)) (special-char-p s))
- (%escape-identifier (convert-to-db-default-case s database) inp)
- (make-instance '%database-identifier :escaped s :unescaped inp)))))))
+ (%escape-identifier
+ (if (special-cased-symbol-p inp)
+ s
+ (convert-to-db-default-case s database)) inp)
+ (make-instance '%database-identifier :escaped s :unescaped inp))
+ )))))
(defun combine-database-identifiers (ids &optional (database clsql-sys:*default-database*)
&aux res all-sym? pkg)