projects
/
clsql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bb46524
)
added the date_part postgresql operator
author
Russ Tyndall
<russ@acceleration.net>
Fri, 24 Apr 2009 18:41:37 +0000
(14:41 -0400)
committer
Russ Tyndall
<russ@acceleration.net>
Fri, 24 Apr 2009 18:41:37 +0000
(14:41 -0400)
sql/operations.lisp
patch
|
blob
|
history
diff --git
a/sql/operations.lisp
b/sql/operations.lisp
index dbe3a0b36ed7cb71689c9e654371cdfa5e43518d..1b52925347434b6e6d56325d7a8ce35a164bc39b 100644
(file)
--- a/
sql/operations.lisp
+++ b/
sql/operations.lisp
@@
-158,6
+158,7
@@
:name 'substr :args rest)
(error 'sql-user-error :message "SUBSTR must have 3 arguments.")))
:name 'substr :args rest)
(error 'sql-user-error :message "SUBSTR must have 3 arguments.")))
+
(defsql sql-substring (:symbol "substring") (&rest rest)
(if (= (length rest) 3)
(make-instance 'sql-function-exp
(defsql sql-substring (:symbol "substring") (&rest rest)
(if (= (length rest) 3)
(make-instance 'sql-function-exp
@@
-259,3
+260,10
@@
(make-instance 'sql-function-exp
:name 'upper :args rest)
(error 'sql-user-error :message "UPPER must have 1 argument.")))
(make-instance 'sql-function-exp
:name 'upper :args rest)
(error 'sql-user-error :message "UPPER must have 1 argument.")))
+
+(defsql sql-date_part (:symbol "date_part") (&rest rest)
+ "the date_part function for postgres"
+ (if (= (length rest) 2)
+ (make-instance 'sql-function-exp
+ :name 'date_part :args rest)
+ (error 'sql-user-error :message "date_part must have 2 arguments.")))