Questions tagged [ktorm]
12 questions
2
votes
0 answers
Why does Sonarqube mark try as a critical issue?
I'm currently facing an issue with some SonarQube's analysis being performed over some Kotlin code I wrote.
I'm trying to implement a method that connects to the database and returns accordingly to the query's result. I'm not sure how related this…

gmtro
- 21
- 2
1
vote
1 answer
Cannot insert java.time.LocalDateTime with zero seconds
Kotlin: 1.6.20
Ktorm: 3.4.1
MySQL Connector/J: 8.0.28
C3P0 Connection Pool: 0.9.5.5
I seem to be having a problem with "datetimes" (LocalDateTime) that have zero seconds. I know this would look like an issue with the JDBC driver but I tested the…

hanzo2001
- 1,338
- 1
- 10
- 24
1
vote
2 answers
How to configure the default Jackson JSON Mapper on Javalin
So far, i found how to replace Javalin json mapper:
https://javalin.io/documentation#configuring-the-json-mapper
But i don't want to replace it, just want to add a few jackson modules, like this…

Sombriks
- 3,370
- 4
- 34
- 54
0
votes
1 answer
Ktorm does not return null
I am writing my server in kotlin ktor and ktorme. There was a problem that the ctor does not return null values.
Here is the database query
return database.safeTransaction {
it.appeals.filter { it.isDeleted eq false }.toList()
…

Alex
- 1
- 1
0
votes
1 answer
Serializing entities and sending response gives the entity property name instead of the column name
I'm trying to understand how to get certain entities through the database and get the column names instead of the property names of the entity and serialize them and send the response.
get("/v1/posts") {
val posts= service.getAll()
…

Marcus Cvjeticanin
- 19
- 6
0
votes
0 answers
How to fetch data based on Los Angeles time on ktor using ktorm with postgres
Please how can I fetch data from database based on Los Angeles Time Zone on Ktor using Ktorm plugin with postgres database.
This is the sample code, but I don't know how to write the query for the sorting based on the timezone
fun getAll(offset: Int…

ABSheikh
- 1
- 2
0
votes
1 answer
groupingBy a join in KTORM
I want to join a N x M relation, returning all N, and a count of how many M are there:
SELECT N.*, COUNT(M.id) FROM N LEFT JOIN M ON N.id = M.n_id GROUP BY N.id
but I don't see how. Joining and aggregation seem to exclude each other, or are not…

Frischling
- 2,100
- 14
- 34
0
votes
1 answer
how to solve the 413 entity too large in Bean Stack Configuration for ktor server?
After deploying the app on beanstack I am getting the 413 Entity too large Exception. I know the reason of this Exception but I don't know where can I need to configure this client request body max size in ktor project or Beanstack.
I tried to…

anas
- 53
- 4
0
votes
0 answers
Ktorm Repository without duplications
I am creating the repository layer using Ktorm, so far I only have insert and update functions.
override fun create(
entity: ObjectEntity
): Either = try {
val id = database.insertAndGenerateKey(TableName) {
…

osumatu
- 410
- 1
- 8
- 25
0
votes
0 answers
SQL equivalent of if not exists in ktorm
I'm currently new to Ktorm with Kotlin and I'm stuck figuring how to only create a table if not exists just like with normal sql DSL.
I'd really appreciate some help with the Ktorm functionality for this.

Kotlin Monk
- 105
- 5
0
votes
1 answer
Kotlin Type Mismatch (interface is not resolved properly)
I am using Ktorm and trying to create an abstract and generic DAO for my tables. In the end I get a type mismatch though and I don't see where I am wrong:
BaseEntity is an interface for an entity class with an id:
interface BaseEntity>:…

Jonathan R
- 3,652
- 3
- 22
- 40
0
votes
0 answers
HikariCP - Postgres Select queries - Executed rollback on connection due to dirty commit state on close()
As part of migrating our service to Kotlin, we wanted to keep our Postgres DB in pure sql and decided to use Ktor(as Native SQL) along with HikariCP as the DataSource for connection pooling.
(For a few reasons, e.g - we're creating our own DOMAINS,…

BVtp
- 2,308
- 2
- 29
- 68