Skip to content

Commit

Permalink
Improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
Thijsiez committed Nov 12, 2024
1 parent 2b793b7 commit 1e080cd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
release:
name: Release main to Maven Central
name: Release to Maven Central
runs-on: ubuntu-latest
if: github.repository == 'Thijsiez/panache-kotlin-dsl'
steps:
Expand All @@ -18,7 +18,6 @@ jobs:
with:
distribution: 'temurin'
java-version: '17'
- run: chmod +x gradlew
- env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
with:
distribution: 'temurin'
java-version: '17'
- run: chmod +x gradlew
- run: ./gradlew koverXmlReport --no-daemon --continue
- env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Release Checklist
- Run all tests to make sure there are no regressions
- Update the `version` in gradle.properties to match this release's tag
- Update all unpinned dependencies in both the library and tests project's gradle.properties
- Make sure the versions in the README's Requirements section match the used dependency versions
- Make sure all tests are passing so we can be fairly sure there are no regressions
- Update `version` in gradle.properties to match this release's tag
- Upgrade all unpinned dependencies in both the library and tests project's gradle.properties
- Make sure the versions in the README's Requirements section match the actual dependencies
- Add a new section to the CHANGELOG describing what has changed
- Update the versions in the README's Getting Started section
- Add a tag with the new version to the commit which will be built and released
- Finally, add a tag with the new version, which will then be built and released
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ A dynamic, type-safe way to write your queries

[Changelog](CHANGELOG.md) | [Contributing](CONTRIBUTING.md)

## Examples
TODO

## Getting Started
<details open>
<summary><b>Gradle Kotlin DSL</b></summary>
Expand Down Expand Up @@ -72,26 +75,23 @@ project.afterEvaluate {
- Your KSP version needs to match your Kotlin version. This is a strict requirement!
For example, when your Kotlin version is `2.0.21`, your KSP version needs to be built for and start with the same version, such as `2.0.21-1.0.25`

## Examples
TODO

## Features
### Queries
- Supports the following expressions in a type-safe and null-safe way for all columns
- `eq`, `neq`, `lt`, `gt`, `lte`, `gte`, `in`, `notIn`, `between`, and `notBetween`
- Supports `like` and `notLike` expressions in a null-safe way for String columns
- Supports `and` and `or` expressions for building up a query
- Adds the `PanacheSingleResult<T>` sealed class and `singleResultSafe()` extension function to return a single result without throwing exceptions.
Allows you to handle no/multiple results with a `when (result) { ... }` block instead of try-catching
- Allows you to handle no/multiple results with a `when (result) {...}` block instead of try-catching
### Code Generation
- Generate `Column`s for non-transient and non-mapped fields in classes annotated `@Entity` and extending `PanacheEntity`/`PanacheEntityBase`
- Generate query entry point extension functions for classes with companion objects extending `PanacheCompanion`/`PanacheCompanionBase`
- Generate `Column`s for non-transient and non-mapped fields in Panache entities
- Generate query entry point extension functions for entities with Panache companion objects
- `where` to start building a SELECT queries, which can be chained to other Panache functions
- `update` with setters to bulk-update multiple rows at once
- Shortcut functions for single expression `count`, `delete`, `find`, `stream`, `single`, `singleSafe`, and `multiple`
- Single expression `count`, `delete`, `find`, `stream`, `single`, `singleSafe`, and `multiple`
- Allows for overriding the generated `Column`'s type parameter using `@ColumnType`
- Especially useful when using a JPA `@Converter` when the field's type is different to the column's type
- Optionally annotate generated code with `@Generated` so it can more easily be excluded from test coverage reporting
- Optionally annotate generated code with `@Generated` so it can be excluded from test coverage reporting

## Known Issues
- Code generation does not handle fields of generic types (e.g. `List<E>`, `Set<E>`, etc.), but as far as I'm aware this is difficult to get working with Hibernate anyway. Consider using a JPA `@Converter` in combination with `@ColumnType`
Expand Down

0 comments on commit 1e080cd

Please sign in to comment.