Re: Supporting ~/.pgpass?

2015-09-02 Thread Marijn Haverbeke
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

Re: Supporting ~/.pgpass?

2015-08-21 Thread Marijn Haverbeke
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,

Re: PostgreSQL date type as bigint in Postmodern

2015-07-19 Thread Marijn Haverbeke
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

Re: Impossible to specify different port number in open-database with CCL1.10

2015-05-21 Thread Marijn Haverbeke
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

Re: S-SQL and nested joins -- correct version

2014-02-28 Thread Marijn Haverbeke
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

Re: on removing build-dao-methods

2014-02-06 Thread Marijn Haverbeke
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'

Re: "Auto-sync" questions

2014-01-28 Thread Marijn Haverbeke
> 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

Re: "Auto-sync" questions

2014-01-28 Thread Marijn Haverbeke
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

Re: Suddenly having trouble with update-dao

2014-01-23 Thread Marijn Haverbeke
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

Re: Simple-date vs local-time

2013-12-30 Thread Marijn Haverbeke
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

Re: doquery for DAOs

2013-12-26 Thread Marijn Haverbeke
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

Re: Parsing for double precision not working yet

2013-11-28 Thread Marijn Haverbeke
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

Re: Possible additional sql-ops

2013-10-26 Thread Marijn Haverbeke
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

Re: What is the easiest way to get the col-type of a slot?

2013-09-08 Thread Marijn Haverbeke
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.

Re: cl-postgres convert nil to false

2013-07-28 Thread Marijn Haverbeke
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

Re: nyef's postmodern gripes

2013-07-24 Thread Marijn Haverbeke
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

Re: [PATCH] Add missing closing parent in example

2013-06-26 Thread 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

Re: [postmodern-devel] A question about connection pooling, and the many ways to connect.

2013-03-16 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Inserting into an array

2013-01-13 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Calling a SQL func as a DAO field value

2012-12-25 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Calling a SQL func as a DAO field value

2012-12-25 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Calling a SQL func as a DAO field value

2012-12-25 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Unix socket directory configuration

2012-09-03 Thread Marijn Haverbeke
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

Re: [postmodern-devel] S-SQL extension :if=

2012-05-14 Thread Marijn Haverbeke
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://

Re: [postmodern-devel] single-key object magic

2012-05-09 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Postmodern and Windows

2012-03-14 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Postmodern and Windows

2012-03-13 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Regression in handling integer dates and timestamps

2012-02-14 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Regression in handling integer dates and timestamps

2012-02-09 Thread Marijn Haverbeke
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

Re: [postmodern-devel] "WHERE id IN (1, 2, 3)" conditions

2011-12-28 Thread Marijn Haverbeke
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

Re: [postmodern-devel] OSX 10.6.8 Intel - SBCL 1.0.54 The function cl-postgres::write-uint4 is undefined.

2011-12-20 Thread Marijn Haverbeke
> 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

Re: [postmodern-devel] Patch: Make :|| (symbol with an empty name) equivalent to :\|\|

2011-11-21 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Patch: Make :|| (symbol with an empty name) equivalent to :\|\|

2011-11-20 Thread Marijn Haverbeke
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

Re: [postmodern-devel] <> operator

2011-11-18 Thread Marijn Haverbeke
> 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

Re: [postmodern-devel] cl-postgres fails to read an empty array

2011-11-03 Thread Marijn Haverbeke
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

[postmodern-devel] Release 1.18

2011-10-19 Thread Marijn Haverbeke
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

Re: [postmodern-devel] setting default value for serial column in prepared insert statement execution

2011-09-04 Thread Marijn Haverbeke
> 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

Re: [postmodern-devel] cl-postgress build warning due to multiple loading

2011-08-13 Thread Marijn Haverbeke
> 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://

Re: [postmodern-devel] cl-postgress build warning due to multiple loading

2011-08-13 Thread Marijn Haverbeke
> 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

Re: [postmodern-devel] cl-postgress build warning due to multiple loading

2011-08-12 Thread Marijn Haverbeke
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

Re: [postmodern-devel] loading trivial-utf-8

2011-08-02 Thread Marijn Haverbeke
> 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

Re: [postmodern-devel] loading trivial-utf-8

2011-07-25 Thread Marijn Haverbeke
> 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

Re: [postmodern-devel] turning off threading support

2011-07-02 Thread Marijn Haverbeke
> 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).

Re: [postmodern-devel] VACUUM, ANALYZE

2011-06-22 Thread Marijn Haverbeke
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

Re: [postmodern-devel] VACUUM, ANALYZE

2011-06-22 Thread Marijn Haverbeke
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

Re: [postmodern-devel] using dao-class on database with column names like "addr:city"

2011-06-14 Thread Marijn Haverbeke
> 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

Re: [postmodern-devel] using dao-class on database with column names like "addr:city"

2011-06-14 Thread Marijn Haverbeke
> 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.,

Re: [postmodern-devel] TRUNCATE missing

2011-05-22 Thread Marijn Haverbeke
> 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

Re: [postmodern-devel] TRUNCATE missing

2011-05-21 Thread Marijn Haverbeke
> (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

Re: [postmodern-devel] TRUNCATE missing

2011-05-20 Thread Marijn Haverbeke
> 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

Re: [postmodern-devel] patch to make postmodern compile

2011-04-24 Thread Marijn Haverbeke
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/

Re: [postmodern-devel] patch for array slicing

2011-04-24 Thread Marijn Haverbeke
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

Re: [postmodern-devel] bug in the array interpreter

2011-04-24 Thread Marijn Haverbeke
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

Re: [postmodern-devel] How to remove trailing spaces?

2011-02-28 Thread Marijn Haverbeke
> 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.

Re: [postmodern-devel] How to remove trailing spaces?

2011-02-28 Thread Marijn Haverbeke
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.

Re: [postmodern-devel] :IN/:NOT-IN on an empty :SET always results in :NULL

2011-02-27 Thread Marijn Haverbeke
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

Re: [postmodern-devel] strange

2011-02-25 Thread Marijn Haverbeke
> (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

Re: [postmodern-devel] :order-by

2011-02-22 Thread Marijn Haverbeke
(: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

Re: [postmodern-devel] date

2011-02-20 Thread Marijn Haverbeke
> (: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

Re: [postmodern-devel] update example

2011-02-17 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Patch: {} syntax for arrays should be inside ''

2011-02-15 Thread Marijn Haverbeke
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

Re: [postmodern-devel] encoding problem

2011-02-15 Thread Marijn Haverbeke
> 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

Re: [postmodern-devel] table name problem

2011-02-14 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Patch: {} syntax for arrays should be inside ''

2011-02-14 Thread Marijn Haverbeke
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

Re: [postmodern-devel] encoding problem

2011-02-14 Thread Marijn Haverbeke
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

Re: [postmodern-devel] encoding problem

2011-02-13 Thread Marijn Haverbeke
>> 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

Re: [postmodern-devel] encoding problem

2011-02-13 Thread Marijn Haverbeke
> 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-

Re: [postmodern-devel] encoding problem

2011-02-13 Thread Marijn Haverbeke
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

Re: [postmodern-devel] encoding problem

2011-02-13 Thread Marijn Haverbeke
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

Re: [postmodern-devel] :set arguments

2011-02-06 Thread Marijn Haverbeke
> 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

Re: [postmodern-devel] :set arguments

2011-02-05 Thread Marijn Haverbeke
> (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" ___

[postmodern-devel] Release 1.17

2011-02-02 Thread Marijn Haverbeke
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

Re: [postmodern-devel] query

2011-01-30 Thread Marijn Haverbeke
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.)

Re: [postmodern-devel] query

2011-01-28 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Date format of alist(s)

2011-01-27 Thread Marijn Haverbeke
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

Re: [postmodern-devel] syncing the socket

2011-01-26 Thread Marijn Haverbeke
> 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

Re: [postmodern-devel] plists

2011-01-26 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Date format of alist(s)

2011-01-26 Thread Marijn Haverbeke
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

Re: [postmodern-devel] plists

2011-01-26 Thread Marijn Haverbeke
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

Re: [postmodern-devel] plists

2011-01-25 Thread Marijn Haverbeke
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

Re: [postmodern-devel] plists

2011-01-25 Thread Marijn Haverbeke
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.

Re: [postmodern-devel] Minor bug in the Simple Date reference manual

2011-01-25 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Can interval be zero?

2011-01-25 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Bulk Copying

2011-01-25 Thread Marijn Haverbeke
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

Re: [postmodern-devel] id field

2011-01-24 Thread Marijn Haverbeke
> 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

Re: [postmodern-devel] Can interval be zero?

2011-01-24 Thread Marijn Haverbeke
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

Re: [postmodern-devel] id field

2011-01-24 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Syntax help requested

2011-01-17 Thread Marijn Haverbeke
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))

Re: [postmodern-devel] Point type

2011-01-02 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Selecting schema with dao-class

2010-12-11 Thread Marijn Haverbeke
> 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)). ___

Re: [postmodern-devel] Minimum overhead per query

2010-12-09 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Quoted lists with QUERY or SQL

2010-11-30 Thread Marijn Haverbeke
> 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

Re: [postmodern-devel] Question on returning multi-dimensional arrays

2010-11-28 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Multiple connections and connection pools

2010-11-24 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Multiple connections and connection pools

2010-11-23 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Problems with doquery and simple-date

2010-11-15 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Parameterized sql strings

2010-11-12 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Retrieving completely populated DAOs based on SQL string query

2010-10-05 Thread Marijn Haverbeke
> (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

Re: [postmodern-devel] Retrieving completely populated DAOs based on SQL string query

2010-10-05 Thread Marijn Haverbeke
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

Re: [postmodern-devel] Postgres 9

2010-08-20 Thread Marijn Haverbeke
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   2   3   >