Skip to content

Commit 8c4953a

Browse files
committed
update samples for 3.2.2
1 parent cb6ce26 commit 8c4953a

File tree

57 files changed

+251
-221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+251
-221
lines changed

samples/kotysa-ktor-jdbc/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ test {
5151
}
5252

5353
wrapper {
54-
gradleVersion = '8.3'
54+
gradleVersion = '8.5'
5555
distributionType = Wrapper.DistributionType.ALL
5656
}

samples/kotysa-ktor-jdbc/gradle.properties

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@ version=0.1
33

44
# plugins
55
# https://kotlinlang.org/docs/releases.html#release-details
6-
kotlin_version=1.9.10
6+
kotlin_version=1.9.22
77

88
# main
99
# https://github.com/ktorio/ktor/releases
10-
ktor_version=2.3.4
10+
ktor_version=2.3.8
1111
# https://mvnrepository.com/artifact/ch.qos.logback/logback-core
12-
logback_version=1.4.11
12+
logback_version=1.4.14
1313
# https://mvnrepository.com/artifact/com.h2database/h2
14-
h2_version=2.2.222
14+
h2_version=2.2.224
1515
# https://mvnrepository.com/artifact/org.kodein.di/kodein-di-framework-ktor-server-jvm
16-
kodein_di_ktor_version=7.20.2
16+
kodein_di_ktor_version=7.21.2
1717
# https://github.com/Kotlin/kotlinx-datetime/releases
18-
kotlinx_datetime_version=0.4.1
18+
kotlinx_datetime_version=0.5.0
1919
# https://github.com/ufoss-org/kotysa/releases
20-
kotysa_version=3.2.1
20+
kotysa_version=3.2.2
2121

2222
#tests
2323
# https://github.com/kotest/kotest/releases
24-
kotest_version=5.7.1
24+
kotest_version=5.8.0
2525
# https://github.com/kotest/kotest-assertions-ktor
2626
kotest_assertions_ktor_version=2.0.0
2727

Binary file not shown.

samples/kotysa-ktor-jdbc/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

samples/kotysa-ktor-jdbc/gradlew

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
145145
case $MAX_FD in #(
146146
max*)
147147
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
148-
# shellcheck disable=SC3045
148+
# shellcheck disable=SC2039,SC3045
149149
MAX_FD=$( ulimit -H -n ) ||
150150
warn "Could not query maximum file descriptor limit"
151151
esac
152152
case $MAX_FD in #(
153153
'' | soft) :;; #(
154154
*)
155155
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
156-
# shellcheck disable=SC3045
156+
# shellcheck disable=SC2039,SC3045
157157
ulimit -n "$MAX_FD" ||
158158
warn "Could not set maximum file descriptor limit to $MAX_FD"
159159
esac
@@ -202,11 +202,11 @@ fi
202202
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203203
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204204

205-
# Collect all arguments for the java command;
206-
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
207-
# shell script including quotes and variable substitutions, so put them in
208-
# double quotes to make sure that they get re-expanded; and
209-
# * put everything else in single quotes, so that it's not re-expanded.
205+
# Collect all arguments for the java command:
206+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207+
# and any embedded shellness will be escaped.
208+
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209+
# treated as '${Hostname}' itself on the command line.
210210

211211
set -- \
212212
"-Dorg.gradle.appname=$APP_BASE_NAME" \

samples/kotysa-ktor-jdbc/src/main/java/module-info.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
module kotysa.ktor.jdbc {
22
requires java.sql;
33
requires com.h2database;
4+
requires io.ktor.http;
5+
requires io.ktor.serialization.kotlinx.json;
6+
requires io.ktor.server.content.negotiation;
47
requires io.ktor.server.core;
58
requires io.ktor.server.host.common;
69
requires io.ktor.server.netty;
710
requires kotlin.stdlib;
11+
requires kotlinx.datetime;
12+
requires kotlinx.serialization.core;
813
requires kotysa.core;
914
requires kotysa.jdbc;
1015

samples/kotysa-ktor-jdbc/src/main/kotlin/com/sample/Models.kt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import org.ufoss.kotysa.h2.dateTime
1010
import java.util.*
1111

1212
data class Role(
13-
val label: String,
14-
val id: UUID = UUID.randomUUID()
13+
val label: String,
14+
val id: UUID = UUID.randomUUID()
1515
)
1616

1717
@Serializable
@@ -23,31 +23,32 @@ data class User(
2323
val roleId: UUID,
2424
val alias: String? = null,
2525
val creationTime: LocalDateTime = Clock.System.now().toLocalDateTime(TimeZone.UTC),
26-
val id: Int? = null
26+
val id: Int = 0
2727
)
2828

2929
/**
3030
* Not an entity
3131
* name = first_name and last_name
3232
*/
3333
data class UserDto(
34-
val name: String,
35-
val alias: String?,
36-
val role: String
34+
val name: String,
35+
val alias: String?,
36+
val role: String
3737
)
3838

3939
// Mapping
4040

4141
object Roles : H2Table<Role>() {
4242
val id = uuid(Role::id)
43-
.primaryKey()
43+
.primaryKey()
4444
val label = varchar(Role::label)
4545
.unique()
4646
}
4747

4848
object Users : H2Table<User>("users") {
49-
val id = autoIncrementInteger(User::id)
50-
.primaryKey()
49+
val id = integer(User::id)
50+
.identity()
51+
.primaryKey()
5152
val firstname = varchar(User::firstname)
5253
val lastname = varchar(User::lastname)
5354
val isAdmin = boolean(User::isAdmin)

samples/kotysa-ktor-jdbc/src/test/kotlin/com/sample/IntegrationTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class IntegrationTests : StringSpec({
2626
kotysaApiTest {
2727
val response = client.get("/api/users/123")
2828
response shouldHaveStatus HttpStatusCode.OK
29-
response.body<User>().id!! shouldBeExactly 123
29+
response.body<User>().id shouldBeExactly 123
3030
}
3131
}
3232
})

samples/kotysa-ktor-r2dbc-coroutines/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ test {
5252
}
5353

5454
wrapper {
55-
gradleVersion = '8.3'
55+
gradleVersion = '8.5'
5656
distributionType = Wrapper.DistributionType.ALL
5757
}

samples/kotysa-ktor-r2dbc-coroutines/gradle.properties

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@ version=0.1
33

44
# plugins
55
# https://kotlinlang.org/docs/releases.html#release-details
6-
kotlin_version=1.9.10
6+
kotlin_version=1.9.22
77

88
# main
99
# https://github.com/ktorio/ktor/releases
10-
ktor_version=2.3.4
10+
ktor_version=2.3.8
1111
# https://mvnrepository.com/artifact/ch.qos.logback/logback-core
12-
logback_version=1.4.11
12+
logback_version=1.4.14
1313
# https://search.maven.org/artifact/io.r2dbc/r2dbc-h2
1414
h2_version=1.0.0.RELEASE
1515
# https://mvnrepository.com/artifact/org.kodein.di/kodein-di-framework-ktor-server-jvm
16-
kodein_di_ktor_version=7.20.2
16+
kodein_di_ktor_version=7.21.2
1717
# https://github.com/Kotlin/kotlinx-datetime/releases
18-
kotlinx_datetime_version=0.4.1
18+
kotlinx_datetime_version=0.5.0
1919
# https://github.com/ufoss-org/kotysa/releases
20-
kotysa_version=3.2.1
20+
kotysa_version=3.2.2
2121

2222
# tests
2323
# https://github.com/kotest/kotest/releases
24-
kotest_version=5.7.1
24+
kotest_version=5.8.0
2525
# https://github.com/kotest/kotest-assertions-ktor
2626
kotest_assertions_ktor_version=2.0.0
2727

0 commit comments

Comments
 (0)