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
> 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
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
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
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
(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))
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
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
This is just a test.
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)
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
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
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
: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
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
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
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
>
[]) (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
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
>
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
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
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
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
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
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
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
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
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,
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
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-
30 matches
Mail list logo