kotlin-exposed Questions
2
Solved
Here is how we get the id of the added row (source):
val munichId = Cities.insert {
it[name] = "Munich"
} get Cities.id
What about getting the whole row? I use map for select operations...
Meiny asked 21/6, 2021 at 10:26
2
I am trying to batch insert records into an SQL table using Kotlin Exposed. I have set up the code as per the Exposed documentation, however, the SQL statements being executed are individual insert...
Tremulous asked 22/8, 2019 at 14:56
1
I want to add a custom field when doing a complex join with a value
Basically something like this:
SELECT p.first_name, "Smith" AS "last_name"
FROM person p
WHERE first_name = ...
Hoax asked 28/5, 2021 at 15:20
1
Solved
I am setting up some many-to-many relationships and have so far been using the Exposed DSL pattern (as opposed to DAO). However, creating many-to-many relationships seem to only be possible using t...
Idolah asked 16/1, 2022 at 23:6
1
Solved
When trying to fetch the first row from my transaction, I receive an error:
java.lang.IllegalStateException: No transaction in context.
My code looks like this:
fun loadPlayer(client: Client)...
How asked 22/4, 2019 at 15:42
5
I have added some Postgresql types to Exposed as extensions. It has two ready types named enumeration and enumerationByName. I tested both of them with no success for mapping a postgre enum type to...
Phyto asked 16/8, 2017 at 22:13
1
I've looked around but cannot seem to find how in the world to 'insert if not exists' or 'insert on conflict' using the Exposed SQL framework for Kotlin. I am currently writing raw SQL statements a...
Swats asked 3/7, 2018 at 15:35
5
I'm trying to run some sql specific to postgres and would like to reuse the transaction management within Exposed.
Slapjack asked 5/12, 2016 at 19:26
3
Solved
I am writing a service using Ktor and Exposed ORM which apparently isn't async. I am coming from the Python world and back there using a blocking ORM with a async IO library is a sin as it may bloc...
Biff asked 18/8, 2017 at 15:23
1
Solved
I want to define a column of type date. This column should hold the current date of the resource created. How do i set this up? I'm new to kotlin.
In python, one would impletement it this way: da...
Elated asked 28/1, 2020 at 16:5
1
I use Exposed as O/R Mapper on Kotlin JVM project.
(version: 0.17.6)
I had trouble with the N+1 query problem when I got a foreign key column's value from DAO API (columns defined by Exposed's ref...
Denounce asked 22/11, 2019 at 11:31
2
Solved
All of the material I can find on Kotlin exposed library assumes that the table has a primary identity column, and so the entities are in most examples shown inherit the IntEntity abstract class. F...
Calhoun asked 23/8, 2019 at 22:44
1
I am new to Kotlin and recently started working on Ktor server. To perform database operations server needs to communicate with MySql server. I started using JetBrains Exposed library to write data...
Jerald asked 4/8, 2019 at 20:8
1
Solved
I have two entities in a One-To-Many relationship. The "One" entity owns the "Many"'s lifecycle. If the "One" entity is deleted, I want all "Many" entities who belong to the "One" to be deleted aut...
Leukas asked 3/5, 2019 at 1:6
1
Solved
I tryed to fix a problem with encodings. So, I sent from 'Postman', from web browser request to server, where I search data in database by keys in request. Request can be like this:
http://localho...
Radman asked 18/11, 2018 at 11:0
0
What I try to do is get a lot of data about heroes in a game and save it in a DB, I use OkHttp to make request to the server and gson to parse the json and then save the classes I get from gson to ...
Spannew asked 29/3, 2018 at 12:22
0
I know that you in general can call Kotlin code from Java, but is this something worth doing when doing Exposed? Or is it's API too tied to the idomatic way of coding Kotlin.
Has any one experienc...
Polyclinic asked 7/2, 2018 at 21:1
1
Solved
I have the following user table object & entity class:
object UserTable : IntIdTable() {
val name = varchar("name", 256)
}
class User(id: EntityID<Int>): IntEntity(id) {
companion obj...
Jaggers asked 8/1, 2018 at 21:26
3
Following the example provided on Exposed I am not able to read the created tables/data outside the transaction creating it. I am using h2-in-memory database.
The exception is:
Exception in threa...
Delphinus asked 5/8, 2017 at 10:33
1
Solved
I'm using Exposed as my database library and I'm getting these errors when I try to run my code:
Exception in thread "main" java.lang.NoClassDefFoundError: kotlin/reflect/full/KClasses
at org.jet...
Nazarite asked 13/6, 2017 at 15:55
1
Solved
On the github page of Jetbrains' Exposed,a Kotlin SQL Framework, there is a link to a page where you can get the maven dependency for this library (https://bintray.com/kotlin/exposed/exposed/view#)...
Interviewer asked 28/2, 2017 at 15:15
1
How do you enable logging of sql queries generated by Exposed in Spring Boot?
The following do not work:
logging.level.org.jetbrains.exposed.sql: DEBUG
logging.level.org.jetbrains.exposed: DEBUG
Wideawake asked 6/2, 2017 at 3:51
1
© 2022 - 2024 — McMap. All rights reserved.