Re: How to connect cl+ssl with host ca verification?

2022-03-26 Thread Sabra Crolleton
onnection >>'("dbname" "dbuser" "password" "some-remote-server.lan" :port 5432 >> :use-ssl :full) >> (postmodern:query (:select '* :from 'table >> >> >> On Tue, Mar 22, 2022 at 8:50 PM

Re: How to connect cl+ssl with host ca verification?

2022-03-22 Thread Sabra Crolleton
> Date: Mon, Mar 21, 2022 at 9:35 PM > Subject: Re: How to connect cl+ssl with host ca verification? > To: Sabra Crolleton > > > That works, but it looks like the root ca has to be added to the system. > If using psql I could specify where all the certs I want to use to connect

Postmodern Query Macro and binary parameters

2021-06-07 Thread Sabra Crolleton
There has been a long standing issue about not having the ability to pass parameters to Postgresql in binary format. Currently all parameters are passed as text and Postgresql figures out what type they should be. Cyrus raised the question about whether passing parameters as binary rather than tex

Re: How to create dao class with identity column as primary key?

2020-06-10 Thread Sabra Crolleton
certain databases, certain schemas or certain tables. Sabra. On Wed, Jun 10, 2020 at 10:43 AM Timo Myyrä wrote: > Sabra Crolleton writes: > > > Hi Timo, > > > > I can probably add the identity column stuff to daos this weekend and > that > > would solve your first iss

Re: How to create dao class with identity column as primary key?

2020-06-09 Thread Sabra Crolleton
mal sql query for users > passwords? > Just define password dao and query it with user id? > > A bit basic questions. The documents and examples show small cases so its > hard > to see the big picture from them. > > timo > > Sabra Crolleton writes: > > > Hello Ti

Re: How to create dao class with identity column as primary key?

2020-06-09 Thread Sabra Crolleton
(username :col-type text :initarg :username :accessor username)) (:metaclass dao-class) (:table-name users) (:keys id)) (username (get-dao 'user 1)) "Jason" (let ((item (make-instance 'user :username "Zenya"))) (insert-dao item)) (username (get-dao 'user 4))

Re: Does anyone use the hstore operators in s-sql?

2018-10-23 Thread Sabra Crolleton
with nested hstore and json objects and examples. On Tue, Oct 23, 2018 at 2:23 AM Anton Vodonosov wrote: > A good way to ensure noone's code is broken is to keep 100% backwards > compatibility. Why would you want to touch the operatiions? > > 21.10.2018, 07:33, "Sabra Crollet

Does anyone use the hstore operators in s-sql?

2018-10-20 Thread Sabra Crolleton
I am looking at the hstore operators in s-sql. Does anyone use them? If so, could you send examples of how you are using them? I want to make sure that if I touch those operators, I do not accidentally break anyone's code. Sabra

test for the mailing list

2018-02-11 Thread Sabra Crolleton
This is just a test.

Re: Suddenly having trouble with update-dao

2014-01-23 Thread Sabra Crolleton
703: column "croatia" does not exist > > QUERY: (SELECT * FROM country WHERE (name = Croatia)) From the html > quickstart > > (let ((croatia (get-dao 'country "Croatia"))) > > (setf (country-inhabitants croatia) 450) > > (update-dao croatia)

Suddenly having trouble with update-dao

2014-01-22 Thread Sabra Crolleton
After a recent quicklisp update, suddenly update-dao throws syntax errors. Simplest example: (update-dao (get-dao 'topic 182)) throws the following error: Database error 42601: syntax error at or near "Border" QUERY: UPDATE topics SET name = Cross Border Transactions, comments = NULL, usergrou

Possible additional sql-ops

2013-10-26 Thread Sabra Crolleton
I have been writing queries requiring window functions and recursive with functions. I finally decided to try to write some sql-ops so that I can use s-sql. They work for me but would appreciate comments. I did include a :parens op because I find that sometimes I just need an additional set of pare

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

2013-09-08 Thread Sabra Crolleton
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. That requires simply checking the col-type for the slot, comparing it to the type for the data and, if they do not match, rejecting the data. I can do it looping through

Re: Timezone handling

2013-07-24 Thread Sabra Crolleton
:timezone local-time::+utc-zone+))) 2013-01-01 04:00:00-08 (looking at the default timezone for the server, PG has kept the timezone as PDT - UTC less 8 hours - but set the time as 04:00:00, which is the time in UTC relative to the PDT time at the server. Does this help? Sabra O

Re: Timezone handling

2013-07-23 Thread Sabra Crolleton
I use the local-time package with encode-timestamp to create the timestamp and just put that into the database. Function: local-time:encode-timestamp nsec sec minute hour day month year &key timezone offset into Returns a new timestamp instance corresponding to the specified time elements. The of

nyef's postmodern gripes

2013-07-20 Thread Sabra Crolleton
Is there a better way to write "common table expressions " (with and with recursive) than: (def-sql-op :with (&rest args) (let ((x (butlast args)) (y (last args))) `("WITH " ,@(sql-expand-list x) ,@(sql-expand (car y) (def-sql-op :with-recursive (&rest args) (let ((x (butlast args)) (y

Re: [postmodern-devel] Inserting into an array

2013-01-13 Thread Sabra Crolleton
Thank you. Sabra On Sun, Jan 13, 2013 at 12:31 PM, Marijn Haverbeke wrote: > 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 >

[postmodern-devel] Inserting into an array

2013-01-12 Thread Sabra Crolleton
[]) (stuff1 :type int4[] What would be the equivalent s-sql to (query "insert into test2 values (1,'t2','{22,24,21,20}','{{2,4},{6,7}}')") Such that (query (:select (:[] 'stuff2 1 1) :from 'test2 :where (:= 'id 1)) :single) #2A((2 4)) Thank

Re: [postmodern-devel] Tutorials, examples, and best practices

2012-11-21 Thread Sabra Crolleton
Attila, Any comments about things you discovered while writing or using this code? Cheers, Sabra On Wed, Nov 21, 2012 at 5:50 AM, Attila Lendvai wrote: > > I'm about to write some production code against a mid-sized, > fully normalized database. Any lessons learned in those kinds of >

Re: [postmodern-devel] Tutorials, examples, and best practices

2012-11-18 Thread Sabra Crolleton
It is probably too basic for you, but you might find something useful at https://sites.google.com/site/sabraonthehill/postmodern-examples It is mostly just notes that I put together for someone on my staff. Cheers, Sabra On Mon, Nov 5, 2012 at 6:48 PM, Patrick May wrote: > Are there

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

2011-01-27 Thread Sabra Crolleton
Sigh. Loading test systems. Bangs head on wall. Thank you, Sabra On Thu, Jan 27, 2011 at 8:26 AM, Marijn Haverbeke wrote: > 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 wi

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

2011-01-27 Thread Sabra Crolleton
Hi Marijn, I think my copy of simple-date is jealously defending its position in my code base. No matter what I do (short of completely erasing simple-date off the system), a postmodern query to a timestamp returns a simple-date object. Sabra On Wed, Jan 26, 2011 at 4:20 AM, Marijn Haverbeke wr

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

2011-01-23 Thread Sabra Crolleton
Hi, Interesting. It seems to be happy if you give it a simple string "0 0:0:0", or, as you've uncovered, 1 millisecond. But it doesn't like the encoding if you use (simple-date:encode-interval :anything 0) Sabra 2011/1/23 Slobodan Milnović > Hi, > > I have an situation where I have an interval

Re: [postmodern-devel] Syntax help requested

2011-01-17 Thread Sabra Crolleton
Marijn, That worked. Your documents are so good and "any" does not appear as a sql-op in the documents, so I did not think to look for an additional any* op in the code. If I can find the time, I think I will compile a giant list of usage examples and put it up somewhere. That will force me to ac

[postmodern-devel] Syntax help requested

2011-01-15 Thread Sabra Crolleton
Hello everyone, I was doing some maintenance and decided to write some meta-functions in s-sql and ran into an issue with "any". In this particular situation I was trying to apply it to pg_index.indkey which is an int2vector. I wanted to get the indexed columns and their attributes from a table

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

2010-11-27 Thread Sabra Crolleton
Hello all, I'm having trouble trying to get a array result out of a database. Assume (query "create table test2 ( id integer, name text, stuff1 integer[] , stuff2 integer[][])") (query "insert into test2 values (5,'t5',array[21,78,93,24],array[[83,92],[16,27]])") If I'm at a psql command line, t

Re: [postmodern-devel] Parameterized sql strings

2010-11-16 Thread Sabra Crolleton
Andy, Am I correct in thinking that you are pointing out that while (query "select name from countries where id=$1" 27) (("Singapore")) works (query "copy $1 to$2" "countries" "/home/sabra/test/test.dat") does not work? Sabra On Fri, Nov 12, 2010 at 8:07 PM, wrote: > Hi, > > Am I correct in

[postmodern-devel] Anyone tried to use the new recursive with in Postgresql 8.4 with S-SQL?

2009-09-30 Thread Sabra Crolleton
I can't seem to get the syntax right using s-sql. I can write a straight sql statement, but it looks ugly in the middle of a lisp program. Sample sql statement from the postgresql docs is: WITH RECURSIVE search_graph(id, link, data, depth, path, cycle) AS ( SELECT g.id, g.link, g.data, 1,

[postmodern-devel] Using get-dao to somehow pull in foreign key linked fields?

2009-08-27 Thread Sabra Crolleton
I was just going to display the fields in a record and my first thought was to use the relevant class and then just call get-dao and iterate over the slots, something like: (item (postmodern:get-dao 'countrynotes (parse-integer id However, looking at the countrynotes definition, yo

[postmodern-devel] Looking for hints on converting from clsql to postmodern

2008-12-28 Thread Sabra Crolleton
One of our postgresql databases has a heavy proportion of foreign language text (all encoded in utf-8).  I was starting to learn lisp by porting a webapplication and got part way into it before I realized that using clsql may require me to manually encode and decode everything from latin to utf-