Fork me on GitHub
#sql
<
2021-01-08
>
Ashwin Bhaskar04:01:02

(sql/update! ds
                           :my-table
                           {:started-at (Instant/now)}
                           {:id         id}
                           {:column-fn  csk/->snake_case
                            :table-fn   csk/->snake_case
                            :builder-fn rs/as-unqualified-kebab-maps})
returns
#:next.jdbc{:update-count 0}
Even thought I gave the builder-fn to return as maps. Why does this happen?

seancorfield05:01:40

@ashwinbhskr I'm not sure what you're asking here?

seancorfield05:01:11

What do you expect to be returned here? An UPDATE statement returns the number of rows affected.

Ashwin Bhaskar05:01:24

> What do you expect to be returned here? An `UPDATE` statement returns the number of rows affected. true, I should I have been clearer with my question. I meant to ask why does it return a namespaced key word? instead of just {:update-count 0}

seancorfield05:01:37

As the docs make clear, the "fake" result set returned in this case is not affected by the builder fn you specify.

👍 3