I suppose you'll have to write a wrapper, yes.
On Sat, Aug 22, 2015 at 2:03 AM, Johann 'Myrkraverk' Oskarsson
wrote:
> Hi Marjin,
>
> On Fri, Aug 21, 2015 at 5:07 PM, Marijn Haverbeke wrote:
>> Hi Johann,
>>
>> Postmodern's scope is definitely not
Hi Johann,
Postmodern's scope is definitely not going to grow anymore. You'll
have to either keep using your snippet as it is, or package it up as a
module that people can install alongside Postmodern.
Best,
Marijn
On Fri, Aug 21, 2015 at 11:01 AM, Johann 'Myrkraverk' Oskarsson
wrote:
> Hi all,
Hello,
What you are getting is a Common Lisp universal-time, not a Unix timestamp.
Best,
Marijn
On Sat, Jul 18, 2015 at 3:59 PM, Rel wrote:
> Hello,
>
> regarding the type date from PostgreSQL, when I query th DB with Postmodern
> like (query "select * from es"), a bigint is returned for date-c
These are optional, not keyword arguments. So leave off the :port
argument, just pass a number as 5th argument.
On Thu, May 21, 2015 at 3:03 PM, Renzo Orsini wrote:
> Using CCL on a Mac (Version 1.10-r16196 (DarwinX8664)),
>
> when I try to open a connection specifying a port:
>
> (cl-postgres:o
Hi Eli,
I don't believe this is supported right now. Take a look at the code
that parses joins, if you want to be sure.
Best,
Marijn
On Fri, Feb 28, 2014 at 2:13 AM, Eli Naeher wrote:
> Hello,
>
> My apologies, I sent my previous email by mistake before I'd finished
> composing it. Here is the
Hi Marco,
Though I'm happy to do baseline maintenance and merging of patches for
the project, I don't have a lot of time to invest in it. And sweeping
changes would need extremely careful review, and would no doubt cause
further issues for other people. So I have to say no, in my
distribution, we'
> Unfortunately I cannot rely on all access going through the writers
> specified in the slot definition. Unfortunately there is a great deal of
> existing code that uses (setf slot-value), with-slots, etc. in this
> codebase.
Ew. Sounds like sed or M-x replace-regexp might the most sane solution
Hi Eli,
I really want to stay as far away from the kind of magic that is
giving database abstactions a bad name. So I don't really think
*db-auto-sync* is a feature that fits in Postmodern.
Doesn't looping over the slots in your class, and defining :after
methods on their setters, solve this with
Yes, recently someone submitted a patch that broke a bunch of things.
It has already been reverted in the git repository, but I guess
quicklisp picked up the broken version (since it seems to assume that
repositories are never broken). Update from git, I guess.
On Thu, Jan 23, 2014 at 9:07 AM, Col
Definitely use local-time. The integration worked well, back in 2007,
and neither library has changed very much since then, so I think you
can feel safe that they are in good shape (others are using them as
well).
On Mon, Dec 30, 2013 at 3:55 PM, Eli Naeher wrote:
> Hello,
>
> I'm working on movi
Hi Eli,
You'd have to somehow combine the query-generating functionality for
DAOs with the incremental result reading of doquery. I haven't looked
into how hard this would be to do through the public API, but I guess
it's a nice piece of functionality to add to the library. Go for it,
I'd say.
Be
Yes, see my response on github. No need to send through multiple channels.
On Wed, Nov 27, 2013 at 3:01 PM, Daniel Brunner wrote:
> [NB: Marjin, I already posted this issue on Github]
>
> Hello!
>
> There is a problem with columns with double precision.
>
> Test case:
> --8<--
> (pomo:query "crea
These look sane. I'd unify :partition-by and :partition-by-order-by
into a single operation (:partition-by ... :order-by ...) by using
split-on-keywords. If you could submit a pull request, preferably even
with some documentation, I'll be happy to merge it in.
Best,
Marijn
On Sat, Oct 26, 2013 at
I don't think there's a way to do it using exported functions. This
isn't a use case I had considered before.
On Sun, Sep 8, 2013 at 5:12 PM, Sabra Crolleton
wrote:
> Feeling a bit brain dead at the moment. I am trying to do a sanity check on
> user-input before the data gets put in a dao-class.
The distinction between nil and :null in Postmodern is a conscious
decision. It makes the CL type 'boolean neatly correspond to Postgres
booleans, and introduces a new type to indicate nullability. I've also
had to write code to convert nils to :nulls in deep data structures a
few occasions, but I
talking
about Postmodern altogether.
(And no, the fact that the mailing list link was broken doesn't excuse
the lack of feedback -- that was only for a few weeks, there's still
the github issue tracker, and it is extremely easy to find my e-mail
address.)
Best,
Marijn Haverbeke
Thanks! Applied as
https://github.com/marijnh/Postmodern/commit/ec537f72393e1032853b78e0b7b4d0ff98632a02
On Wed, Jun 26, 2013 at 9:45 PM, Julien Danjou wrote:
> ---
> doc/s-sql.html | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/doc/s-sql.html b/doc/s-sql.html
> index a
Hi Jim,
You're right, you have to use local connection and specify that you
want them to be pooled. (This model has much less overhead -- a single
synchronization point -- than a model where a single handle can be
used in a multi-threaded way.)
Best,
Marijn
On Sat, Mar 16, 2013 at 2:32 AM, Jim
This seems to work:
(pomo:execute (:insert-into 'test2 :set 'id 1 'name "t2" 'stuff1
#(22 24 21 20) 'stuff2 #(#(2 4) #(6 7
Best,
Marijn
On Sun, Jan 13, 2013 at 6:58 AM, Sabra Crolleton
wrote:
> I thought I understood the s-sql syntax on inserting into an array. Then I
> tried it. No, I
PM, Julien Danjou wrote:
> On Tue, Dec 25 2012, Marijn Haverbeke wrote:
>
>> If I do
>>
>> cl-user> (s-sql:sql (:now))
>>
>> It produces "now()" for me.
>
> Sure, for me too. So let me give you a bit more context.
>
> If you've a clas
If I do
cl-user> (s-sql:sql (:now))
It produces "now()" for me.
On Tue, Dec 25, 2012 at 9:36 PM, Julien Danjou wrote:
> On Tue, Dec 25 2012, Marijn Haverbeke wrote:
>
>> Doesn't (:now) work?
>
> No, I get:
>
> Value (:NOW) can not be converted to an
Doesn't (:now) work?
On Tue, Dec 25, 2012 at 9:22 PM, Julien Danjou wrote:
> Hi,
>
> I'm trying to use NOW() as a value in an update statement using the DAO.
> I've tried of syntax combinations, but I can't get the right one.
>
> Hint?
>
> --
> Julien Danjou
> /* Free Software hacker & freelance
Hi Zach,
I've exported and documented the variable in
https://github.com/marijnh/Postmodern/commit/c7b49bd075923bc3861b15c1ae944d28311be84a
. The leading-slash thing is nice, but since support for unix sockets
is currently a hack only supported on SBCL+Unix, I didn't feel
comfortable integrating i
Hi Andy,
If you want, you can create a wiki page on the Postmodern github wiki
[1] for people to collect such snippets. There's not no huge community
around Postmodern, so I'm not sure how much of a market there is for
sharing snipptets, but it can't hurt to preserve them somewhere.
[1]: https://
Hello Greg,
I'm hesitant to incorporate any 'magic' like this into the core
library. It's a matter of aesthetics, but I'm no big fan of this kind
of do-what-I-mean API style. I prefer explicitness. If you want to
work on a library that does a lot of helpful things under the covers,
I think that's
Great! Thanks for following up here.
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://lists.common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel
Hello Daniel,
I have never tested on windows. One possible scenario that might
result in an error like this is if Clozure is using a stream
encoding/locale where it helpfully inserts carriage returns after
newlines in stream write operations. I'm not familiar enough to with
Clozure to know what to
Did you verify that those older version of cl-postgres work with your
current set-up (schema, postgres server etc)? If I revert to the
version from June last year, I get the exact same error.
___
postmodern-devel mailing list
postmodern-devel@common-lisp
It could be that simple-date is being accidentally (or intentionally)
loaded. Could you check whether the :simple-date package is present?
That will register handlers for serializing date and time values,
which might cause the behaviour you describe. These two patches might
be to blame:
https://gi
See http://marijnhaverbeke.nl/postmodern/s-sql.html#set . (You want
(:in foo (:set 1 2 3)) , or, when the set is not static, (:in foo
(:set x)) where x holds a list.
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://lists.common-l
> cl-postgre::write-uint4 undefined (messages.lisp)
If this is the actual error message, then your source is most likely
corrupted somehow (the symbol is "cl-postgres::write-uint4"). This is
definitely not a problem with your PostgreSQL setup. The write-uint4
function should be defined by cl-postg
Okay, fine by me. I've fixed your patch to properly handle
compile-time expansion, and added a note to the docs.
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://lists.common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel
Hi Stas,
This seems a bit overly obscure. It should be easy to add this in a
project (outside of S-SQL) if you find that typing \|\| is slowing you
down, but I'd rather not put it in the library itself.
Best,
Marijn
___
postmodern-devel mailing list
po
> Out of SQL habit I used <> for inequality yesterday and got this error:
I guess I missed that one when defining operators. Added now (in git repo).
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://lists.common-lisp.net/cgi-bin
Something that sounds similar to this was fixed in
https://github.com/marijnh/Postmodern/commit/de3d753dbf698fe75a01f7f1544f3c031e1a635c
. Could you get the latest version and see if the problem still occurs
there?
Best,
Marijn
___
postmodern-devel mail
I just tagged the current version as release 1.18. See the project
page [1] for a summary of changes.
[1]: http://marijnhaverbeke.nl/postmodern
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://lists.common-lisp.net/cgi-bin/mailm
> I am working around by having separate insert statements one with and one
without the auto increment column.
I think this is your best bet, yes. I don't think postgres supports what you
wanted to do. If you find a way (in raw sql) let me know.
___
post
> It was intended like this?
Yes. This way you can also choose to use local-time for date/time
representation, or not load a date/time data structure at all if you
don't need it.
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://
> I don't understand how is simple-date supposed to be loaded now. Just
> loading postmodern doesn't seem to be sufficient anymore. Should it be
> loaded explicitly?
Yes. (And it has been like this for a long time.)
___
postmodern-devel mailing list
pos
I've pushed a patch. Apparently ASDF2's operation-done-p claims that a
package has been loaded, even when it hasn't. This was causing the
glue to be loaded after both systems, rather than after the one that
got loaded last. I've committed a patch that makes the check a bit
more crude, checking dire
> What do you think of removing these two files? Since Quicklisp it is much
> easier to load libraries.
That would also be an option, but I think I prefer the cruder approach
of just using a different name for now. Quicklisp probably made things
better, but the proliferation of tiny packages is st
> In my project trivial-utf-8 is already loaded. Postmodern does it again
> which leads to warnings:
If convenient, you can arrange for the other load not to happen, since
whichever software is loading it will be able to use the on in
Postmodern as well.
For a proper solution, the package name us
> Am real, real new at this and can't figure out what to change.
If you remove the expression that pushes :postmodern-thread-safe to
*features* (including the #+ form before it, locks on thread pools
will be disabled (and bordeaux-threads won't be loaded).
Err, John. I half-read the -jm at the bottom and made Jim out of it. Sorry.
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://lists.common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel
Hi Jim,
Looks like these ops have a very simple structure. Maybe simply
scanning the arguments for those keywords 'by hand' yields more
pleasant code? That'll also make it easier to put the table and column
names at the end.
Best,
Marijn
___
postmodern
> I would be happy with any mechanism at all which would enable me to
> cope with such non-conforming databases. What's the Right Thing to
> do?
The problem is that Postmodern went with a 'simplify Lisp symbols to
get credible SQL names' scheme that assumes those credible SQL names
are not escape
> A trip into the debugger leads me to believe that the slot name
> |addr:city| in the dao-class defclass gets rewritten as "addr_city",
If colons are safe in SQL field names, you can change
s-sql::to-sql-name to leave them intact (there seems to already by an
exception for * characters).
> p.s.,
> I was expecting to be able to write forms such as:
>
> (:truncate 'foo 'bar :only :restrict)
> (:truncate 'foo :restart-identity :cascade)
> (:truncate 'foo)
>
> Ie. without keyword arguments.
That's not how split-on-keywords works, but you can very easily do
that with a destructuring-bind an
> (def-sql-op :truncate (&rest args)
> (split-on-keywords ((tables *) (only - ?) (identity - ?) (fkey - ?))
> (cons :tables args)
> (let ((identity-str (case identity
> (:restart-identity "RESTART IDENTITY ")
> (:continue-identity "CONTINUE
> It seems the TRUNCATE¹ operation is missing, would it be possible to add
> it to postmodern?
You could, and I'd welcome such a patch. But since it's a rather
simple command, you can also just use a string to issue it.
___
postmodern-devel mailing list
Hi Nicolas,
I'm not getting this error on SBCL 1.0.47, and in fact it would be
quite strange for a CL not to accept forward uses of classes.
Best,
Marijn
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://common-lisp.net/cgi-bin/
Thanks, looks good. Applied.
Best,
Marijn
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel
Thanks for the report. This was a bug in the dimension-counting code.
I've pushed a fix.
Best,
Marijn
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel
> I meant that I thougth that postgresql could be faster with fixed
> lenght fields, not postmodern, sorry... :-D
Benchmark this, before you make life hard for yourself. I seem to
remember an expert telling me that fixed char columns are rarely
useful anymore.
Hi Slobodan,
Firstly, I very much doubt Postmodern will be faster for fixed-length
fields. I doesn't special-case them at all, so they are sent in the
exact same way as other strings. And even if they were, there is no
reason they'd be faster -- the Postgres protocol null-terminates every
string.
Hi J.P.,
The (NULL) thing is a bit of a cop-out on my part since I, too,
couldn't figure out how to properly represent the empty set. I'd be
okay with just rigging :in and :not-in to check their rhs for nil and
expand to a boolean — people who do :null in {} are just asking for it
— but if you com
> (query (sql-compile `(:insert-into 'kupci :set
> ,@(list 'vrijemeunosa (:now)
>
> If I try to execute it from repl it works
> but when called within function I get
This does not work from the repl either. You forgot a quote.
___
postmodern-devel m
(:order-by (:select '* :from 'table) (:desc 'column))
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel
> (:insert-into 'table :set 'ts :now)
>
> This doesn't work.
> How do I insert current date/time then ?
Try (:insert-into 'table :set 'ts (:now)) .
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman
Hi Haris,
The docs are a bit unclear on this one. I've updated them. Here's an example
(s-sql:sql (:update 'foo :set 'a 10 'b 20 :where (:= 'c 30)))
Best,
Marijn
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://common-lisp
Thanks! Pushed to the repository.
Best,
Marijn
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel
> Sorry for the noise, and thank you for trying to help me.
No problem, glad to see you figured it out.
Cheers,
Marijn
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel
cl:t, cl:nil, and :null have a special meaning in s-sql. In this case,
you can work around it by using :t or '#:t instead of 't in your
query.
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listi
Hi Stas,
What happens when, with your patch, you try to pass an array as a
query parameter? ($1, etc) I suspect the correct thing to do would be
to return T as a second value from to-sql-string (which indicates that
the string should be escaped when put into a query), rather than
putting quotes in
Hi Nicolas,
Still no luck reproducing this. Does this simple query fail too?
(query "select '’'")
If not, you might want to double-check your database encodings.
Best,
Marijn
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://co
>> Also, again, which version of Postgres are you using?
> Ooops :) I use the git version, 5fe54bd.
I meant PosgreSQL, not Postmodern.
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/po
> Yep, no problem with ascii.
Sure, but that's not what I asked. Does this query from the quickstart
work? (query "select 22, 'Folie et déraison', 4.5")
Also, again, which version of Postgres are you using?
___
postmodern-devel mailing list
postmodern-
Hm. Then, this would suggest a bug somewhere. Do simpler non-ascii
things work? (For example, walk through the quickstart.) Can you give
me your Postgres version, and the exact query that goes wrong?
Best,
Marijn
___
postmodern-devel mailing list
postmo
After loading the system, check the value of
cl-postgres-system::*unicode* . Is it T?
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel
> How do I do it if I have multiple IFs like:
>
> (sql-compile `(:insert-into 'kupci :set ,@((if TEST (list 'ime "a")
> (if TEST2 (list 'prezime "b")
The first step would be understanding how quasiquoting works. This is
not a Postmodern question, but a basic Common Lisp one. There are
other ch
> (sql (:insert-into 'kupci :set (:raw (if t (sql ('ime "a"))
The :insert-into clause expects the arguments to :set to be a multiple
of two. You'll need to use sql-compile to do this.
(sql-compile `(:insert-into 'kupci :set ,@(when t (list 'ime "a"
___
Most users are probably already using the git HEAD (which is pretty
safe, since I don't push many wild experimental patches), but I just
released a new version. The important changes are:
* Fixes day-of-week in simple-date.
* Makes the :plist query format actually work.
* Adds sql-escape as an exp
Good to see you figured it out!
(As an aside, please try to actually reply to your thread, rather than
starting a new one for each mail. I'm not sure what you did wrong, but
both gmail and the mailing list archive show this conversation as four
different threads.)
You could make that part of the query dynamic, like this:
(sql (:select '* :from 'kupci :where (:and (:raw (if TEST (sql (:like
'ime (concat-string "%" (parameter "ime") "%"))) t))
(:raw (if
TEST2 (sql (:like 'prezime (concat-string "%" (pa
Could it be that you're using an old Postmodern version? Or that
you're loading the test systems (those depend on
:simple-date-postgres-glue, which will cause this wiring-in to
happen).
Best,
Marijn
___
postmodern-devel mailing list
postmodern-devel@com
> My bulk copier is somewhat working now but the next time I try to issue a
> query on
> the same connection (using cl-postgres:exec-query), I'm getting
> "Unexpected message
> received: Z". I thought that putting a "try-to-sync" after sending my
> CopyDone
> message should prevent this but appare
This should do the trick:
git clone http://marijnhaverbeke.nl/git/postmodern
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel
Hi Phil,
Simple-date, and the glue that integrates it in Postmodern, is no
longer loaded by default. Load the :simple-date-postgres-glue system
to get the old behaviour.
I actually recommend people to use local-time rather than simple-date
now (it also has cl-postgres glue code in its distributio
Coming back to this problem...
> Error: Undefined operator NIL in form (NIL (CL-POSTGRES:EXEC-QUERY
> *DATABASE* "select * from table1;" (QUOTE
> POSTMODERN::SYMBOL-PLIST-ROW-READER)))
Last night I suddenly realized that this is a bug that was fixed a
long time ago [1]. Get the current code from
Hi Haris,
> I tried (query "select * from table1;" :plists) but I get:
>
> Error: Undefined operator NIL in form (NIL (CL-POSTGRES:EXEC-QUERY
> *DATABASE* "select * from table1;" (QUOTE
> POSTMODERN::SYMBOL-PLIST-ROW-READER)))
Interesting. On Allegro this seems to work fine. I don't have
Lispwor
Hey,
> (query "select * from table1;" :plists t)
It is not a keyword argument. Rather, there is a regular optional
argument that gets a keyword value that determines the output format.
(query "select * from table1;" :plists) should work.
> P.S. What's with the Croatia example ? I'm from Croatia.
Hi Sebastian,
Thanks for catching that. I've pushed a fix.
Best,
Marijn
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel
Hi Slobodan,
Ugh. That seems to always happen when I push something out without
fully testing it. Thanks for the fix, applied.
Best,
Marijn
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listin
Hi Andy,
Your approach sounds good. I've never used bulk data copying, so I
can't really give very useful feedback. As for debugging, well, have
the code log what it's sending and then double-check with the protocol
docs—there are often subtle gotchas described in the 'message flow'
document that
> Then I don't need primary key ?
(Read up on what primary keys really do.)
> If I choose my primary key to be an integer
> then I have to keep track of numbers and automatically
> insert number incremented by one ?
No, Postgres supports automatically assigned IDs as well, but you have
to specif
Hi Slobodan,
I've pushed a patch to fix this. You now get "0 milliseconds" when
serializing an interval whose components are all 0. I hope that solves
the problem.
Best,
Marijn
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://c
Hi Haris,
Fields are only automatically filled when they have a default value.
Does your table have a default value set for the id column?
Best,
Marijn
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://common-lisp.net/cgi-bin/ma
Hi Sabra,
user> (s-sql:sql (:select 'pg_attribute.attname (:format-type
'pg_attribute.atttypid 'pg_attribute.atttypmod)
:from 'pg_index 'pg_class 'pg_attribute
:where (:and (:= 'pg_class.oid (:type '$1 regclass))
Hi Slobodan,
To make this kind of thing less awkward, your best bet is to define a
reader and a writer for the type. You can find the details in the
reference guide [1], but in short, you'd:
- Find a Lisp type you want to use for values of this type. In this
case, I think (defstruct point x y) is
> But it seems (:dot 'scheme-name 'table-name) format is supported only
> in queries? How can I select an schema in database?
The table-name has to be a string, and is not evaluated. You could
just do (:table-name "schema_name.table_name"). Or use #.(sql (:dot
'foo 'bar)).
___
100 ms overhead for a tiny query sounds very wrong. I just tried this
out as well -- (time (query (:select 1))) -- and am seeing about .8
milliseconds average. If such a query from another tool is also taking
120ms, I think you should look for the problem in your server, since
this shouldn't be tak
> Is there a reason that query doesn't support evaluated lists?
Yes. These macros also accept string input, and assume that everything
that's not a list starting with a keyword will evaluate to a string.
> If so, how would you recommend this be done?
You can either add an sql-compile around your
Hi Sabra,
I hadn't taken multi-dimensional arrays into account when writing the
array parsing/serializing code. I've pushed an update to the git repo
that should resolve your issue.
Best,
Marijn
___
postmodern-devel mailing list
postmodern-devel@common
Good to hear you've solved the issue. Don't worry about the occasional
false alarm -- it makes the mailing list look alive ;)
___
postmodern-devel mailing list
postmodern-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-de
Hi Slobodan,
Firstly, your snippet works for me (if I substitute meaningful stuff
for your placeholders), and should work -- the inner with-db should
open (or fetch from the pool) a fresh connection, that can be used
even while the outer connection is processing a query (doquery will
run its body
Let's take Postmodern out of the picture for a second...
CL-USER> (decode-universal-time (get-universal-time))
19
28
8
16
11
2010
1
NIL
-1
CL-USER> (dotimes (i 1) (decode-universal-time (get-universal-time)))
NIL
See the pattern?
A loop doesn't return the value of its body, typically, since that
Hi Andy,
I also just replied on github -- basically, you can just *use* raw
strings wherever Postmodern expects an s-sql expression (the two can
be distinguished at compile time) and it will work.
Best,
Marijn
___
postmodern-devel mailing list
postmode
> (select-dao 'foo-db-name (:in 'foo.id (:set (flatten (query "SELECT DISTINCT
> foo.id FROM foo_member INNER JOIN foo_show ON (foo_member.id =
> foo_show.member_id) INNER JOIN foo_series ON (foo_show.series_id =
> foo_series.id) WHERE foo_series.year = 2011
Ouch! You could express the IN test
Hi Mitch,
> (select-dao 'foo-db-name (:in 'foo.id (:set (flatten (query "SELECT
> DISTINCT foo.id FROM foo, etc.")
I'm not quite sure what you are trying to achieve. Unless the 'etc'
was relevant, you seem to be selecting all ids from your foo table,
and then select only those rows in the foo
Hi Derrick,
> I was wondering if there would be any changes necessary to Postmodern with
> the upcoming release of Postres 9, or if it would work just as well with the
> new version?
It should just work, but I haven't tested against any development
snapshots or studied the changelog, so who knows
1 - 100 of 229 matches
Mail list logo