How about: (query-exec conn (format "INSERT INTO some_table (ip) VALUES
(inet '~a')" client-ip))

On Sun, Jan 17, 2016 at 6:35 PM, Alexis King <lexi.lam...@gmail.com> wrote:

> The DB docs for SQL type conversions[1] note that not all Postgres types
> are supported by Racket, and it recommends using a cast to work around
> this. It even uses the inet type as an example right at the start of the
> page. However, I want to store an inet value in my database, not query
> an inet value out, and I can’t figure out what set of casts I need for
> the right coercion to take place.
>
> My query looks like this:
>
>   (query-exec conn "INSERT INTO some_table (ip) VALUES ($1)" client-ip)
>
> Attempting to execute that query gives me the following error:
>
>   query-exec: unsupported type
>     type: inet
>     typeid: 869
>
> Is there any way to annotate this so that I can insert into that table?
>
> [1]: http://docs.racket-lang.org/db/sql-types.html
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to