seancorfield / next-jdbc

A modern low-level Clojure wrapper for JDBC-based access to databases.
https://cljdoc.org/d/com.github.seancorfield/next.jdbc/
Eclipse Public License 1.0
768 stars 90 forks source link

When writing new SQL-level functions, the private builder stuff is useful #81

Closed seancorfield closed 4 years ago

seancorfield commented 4 years ago

@zcaudate wrote some (PostgreSQL-specific) upsert functions and used several of the private functions from next.jdbc.sql. Those should be made public in a new next.jdbc.sql.builder namespace for folks who want to leverage them.

That means documenting them properly and moving tests etc.

zcaudate commented 4 years ago

There where two things I added for Postgres:

seancorfield commented 4 years ago

All the for-* SQL builders support a :suffix option now, which will make the code for your upserts easier to write since you can reuse for-insert/for-insert-multi with the ON CONFLICT ... string passed in as the :suffix.