https://github.com/peter-evans/jooq-pg-int8multirange
Custom jOOQ binding for PostgreSQL int8multirange type
https://github.com/peter-evans/jooq-pg-int8multirange
jooq jooq-binding jooq-converter multirange postgres-multirange postgresql
Last synced: about 2 months ago
JSON representation
Custom jOOQ binding for PostgreSQL int8multirange type
- Host: GitHub
- URL: https://github.com/peter-evans/jooq-pg-int8multirange
- Owner: peter-evans
- License: mit
- Created: 2022-03-18T09:07:37.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-04T09:10:00.000Z (over 2 years ago)
- Last Synced: 2024-10-05T11:41:39.941Z (over 1 year ago)
- Topics: jooq, jooq-binding, jooq-converter, multirange, postgres-multirange, postgresql
- Language: Kotlin
- Homepage:
- Size: 71.3 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jOOQ-pg-int8multirange [
](https://peterevans.dev/posts/postgres-multirange-types-with-jooq/)
[](https://github.com/peter-evans/patience/actions/workflows/ci.yml)
Custom jOOQ binding for PostgreSQL int8multirange type.
# About
PostgreSQL 14 introduces [built-in multirange types](https://www.postgresql.org/docs/14/rangetypes.html).
Support for these types is [not yet available in jOOQ](https://github.com/jOOQ/jOOQ/issues/13172).
This repository demonstrates a custom binding and converter to allow jOOQ to work with these types.
# Usage
Create a field and set the `DataType` with the binding.
```kotlin
private val rangesField = field(
name("test", "ranges"),
SQLDataType.VARCHAR.asConvertedDataType(Int8MultiRangeBinding())
)
```
See [Int8MultiRange](src/main/kotlin/Int8MultiRange.kt) and associated [tests](src/test/kotlin/Int8MultiRangeTest.kt) for working examples.