Hello, forum!
I have a dao class that uses 'date' col-type: (reg_date :col-type date :initarg :date :accessor user-reg-date :initform (get-current-simple-date)))
here is a (get-current-simple-date) result: #<SIMPLE-DATE:DATE 17-10-2009>
but the following error is generated when I'm trying to instantiate the object: Value #<SIMPLE-DATE:DATE 17-10-2009> can not be converted to an SQL literal. [Condition of type SIMPLE-ERROR]
Thanks in advance!
Hello Mikhail,
To get this to work, you need to ensure the code in simple-date/cl-postgres-glue.lisp is loaded. This is done by either ensuring simple-date is loaded *after* cl-postgres, or explicitly loading the simple-date-postgres-glue package.
Best, Marijn
great, it worked when I did the 'load' with this file. but (asdf:oos 'asdf:load-op :cl-postgres-glue) failed because there is no such package in postmodern
2009/10/17 Marijn Haverbeke marijnh@gmail.com:
Hello Mikhail,
To get this to work, you need to ensure the code in simple-date/cl-postgres-glue.lisp is loaded. This is done by either ensuring simple-date is loaded *after* cl-postgres, or explicitly loading the simple-date-postgres-glue package.
Best, Marijn
postmodern-devel mailing list postmodern-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel
this is strange, but even if I load simple-date later after cl-postgres:
; into #<PACKAGE "ASDF0"> ; registering #<SYSTEM :CL-POSTGRES {AA54A31}> as CL-POSTGRES ; registering #<SYSTEM :CL-POSTGRES-TESTS {AB78C59}> as CL-POSTGRES-TESTS ; loading system definition from ; /home/mico/.sbcl/systems/trivial-utf-8.asd into #<PACKAGE "ASDF0"> ; registering #<SYSTEM :TRIVIAL-UTF-8 {AD95BA1}> as TRIVIAL-UTF-8 ; registering #<SYSTEM :TRIVIAL-UTF-8-TESTS {AEB9419}> as ; TRIVIAL-UTF-8-TESTS ; loading system definition from /home/mico/.sbcl/systems/ieee-floats.asd ; into #<PACKAGE "ASDF0"> ; registering #<SYSTEM :IEEE-FLOATS {B093D41}> as IEEE-FLOATS ; registering #<SYSTEM :IEEE-FLOATS-TESTS {B1BB8D9}> as IEEE-FLOATS-TESTS ; loading system definition from /home/mico/.sbcl/systems/usocket.asd into ; #<PACKAGE "ASDF0"> ; registering #<SYSTEM USOCKET {B3B0D49}> as USOCKET ; loading system definition from ; /home/mico/.sbcl/systems/split-sequence.asd into #<PACKAGE "ASDF0"> ; registering #<SYSTEM :SPLIT-SEQUENCE {ADE3711}> as SPLIT-SEQUENCE ; loading system definition from /home/mico/.sbcl/systems/md5.asd into ; #<PACKAGE "ASDF0"> ; registering #<SYSTEM MD5 {AF8A741}> as MD5 ; loading system definition from /home/mico/.sbcl/systems/simple-date.asd ; into #<PACKAGE "ASDF0"> ; registering #<SYSTEM :SIMPLE-DATE {B1863C9}> as SIMPLE-DATE ; registering #<SYSTEM :SIMPLE-DATE-TESTS {B2AA089}> as SIMPLE-DATE-TESTS
I got the same error too. It works for me only if I run load cl-postgres-glue manually after all. It is 1.14 version of postgres btw. And thanks for your quick reply, Marijn
2009/10/17 Mikhail Shevchuk mikhail.shevchuk@gmail.com:
great, it worked when I did the 'load' with this file. but (asdf:oos 'asdf:load-op :cl-postgres-glue) failed because there is no such package in postmodern
2009/10/17 Marijn Haverbeke marijnh@gmail.com:
Hello Mikhail,
To get this to work, you need to ensure the code in simple-date/cl-postgres-glue.lisp is loaded. This is done by either ensuring simple-date is loaded *after* cl-postgres, or explicitly loading the simple-date-postgres-glue package.
Best, Marijn
postmodern-devel mailing list postmodern-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel
but (asdf:oos 'asdf:load-op :cl-postgres-glue) failed because there is no such package in postmodern
For one, it is called simple-date-postgres-glue, and it is inside of the simple-date.asd file, so you have to load the simple-date system before asdf even finds it.
Why loading simple-date after cl-postgres does not work I do not know. You can look at simple-date.asd, the code in there is simple and shouldn't be hard to debug.
I got it work good using the attached patch. I've just put straight :depends-on (file "cl-postgres-glue") instead of (eval-when) call.
2009/10/17 Marijn Haverbeke marijnh@gmail.com:
but (asdf:oos 'asdf:load-op :cl-postgres-glue) failed because there is no such package in postmodern
For one, it is called simple-date-postgres-glue, and it is inside of the simple-date.asd file, so you have to load the simple-date system before asdf even finds it.
Why loading simple-date after cl-postgres does not work I do not know. You can look at simple-date.asd, the code in there is simple and shouldn't be hard to debug.
postmodern-devel mailing list postmodern-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel
Hey Mikhail,
You should probably try with the darcs version. I just noticed something was changed in simple-date.asd since the last release, also replacing the eval-when with something else.
darcs get http://common-lisp.net/project/postmodern/darcs/postmodern
Best, Marijn
Yes, that version works like a charm. Thanks a lot, Marijn!
2009/10/18 Marijn Haverbeke marijnh@gmail.com:
Hey Mikhail,
You should probably try with the darcs version. I just noticed something was changed in simple-date.asd since the last release, also replacing the eval-when with something else.
darcs get http://common-lisp.net/project/postmodern/darcs/postmodern
Best, Marijn
postmodern-devel mailing list postmodern-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel
postmodern-devel@common-lisp.net