fix #279 by adding missing docs

Signed-off-by: Sean Corfield <sean@corfield.org>
This commit is contained in:
Sean Corfield 2024-05-17 18:20:37 -07:00
parent c77f7539c6
commit 49a22db52e
No known key found for this signature in database
2 changed files with 13 additions and 1 deletions

View file

@ -4,6 +4,7 @@ Only accretive/fixative changes will be made from now on.
* 1.3.next in progress
* Fix [#280](https://github.com/seancorfield/next-jdbc/issues/280) by allowing `-` as well as `_` in `nav` foreign key names.
* Address [#279](https://github.com/seancorfield/next-jdbc/issues/279) by adding the missing documentation.
* Update dev dependencies, including testing against Clojure 1.12 Alpha 11.
* 1.3.925 -- 2024-03-15

View file

@ -36,7 +36,18 @@ For `:fk-suffix`, the `_` is still permitted and optional in the column name,
so if you specified `:schema-opts {:fk-suffix "fk"}` then `addressfk` and
`address_fk` would both be treated as foreign keys into the `address` table.
The `:pk-fn` can
_Note: as of 1.3.next, `-` is permitted in key names (in addition to `_`) so that kebab result set builders work as expected._
The `:pk-fn` can use the table name to determine the primary key column name
for exceptions to the `:pk` value. For example, if you have a table `address`
with a primary key column `address_id` instead of `id`, you could use:
```clojure
:pk-fn (fn [table pk]
(if (= "address" table)
"address_id"
pk))
```
The default behavior in the example above is equivalent to this `:schema` value: