https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
exposed
  • j

    jfburdet

    01/13/2020, 2:37 PM
    Hi. I need some help to map a SQL query for a 'greatest-n-per-group' problem to exposed DSL. It uses several JOIN with some subselect, and I have no idea where to start to translate this to the DSL. Here is the raw query. Any hints will be appreciated 🙂
    SELECT p.id, p.title
    FROM Publication p
    JOIN ( 
    	 SELECT psc.publicationId, psc.publicationStateId ,max(psc.id) 
    	 FROM PublicationStateChange  psc
    	 GROUP BY psc.publicationId
    	) lastpsc ON p.id = lastpsc.publicationId and lastpsc.publicationStateId = ps.id
    JOIN PublicationState ps ON ps.id = lastpsc.publicationStateId
    
    WHERE ps.tag = "new"
    ;
    t
    4 replies · 2 participants
  • s

    SackCastellon

    01/13/2020, 11:03 PM
    @tapac I was thinking about adding some missing Javadoc and also fixing the code formating which in some places is crazy. And I wanted to know if I should make one big PR for the documentation and one for the formating, multiple PR in each case. Also about formating, I think there should be some guidelines about what code style contributors should follow and maybe committing files in folders
    .idea/codeStyles/
    and
    .idea/inspectionProfiles/
    👍 2
    t
    1 reply · 2 participants
  • r

    Rodrigo Silva

    01/17/2020, 1:00 PM
    Can i use exposed with mongodb?
    e
    t
    4 replies · 3 participants
  • s

    savrov

    01/20/2020, 11:08 AM
    Hello. Lets say, i need to reset in-memory database before each test. Reset - delete all existed rows and add default ones. But the problem is that after I call
    deleteAll()
    the PK value is not reseted to 0. Is there a way to do it?
    t
    3 replies · 2 participants
  • t

    Timur Atakishiev

    01/23/2020, 11:42 AM
    Hi guys, is it any possibility to call stored procedure from exposed?
    b
    1 reply · 2 participants
  • s

    Slackbot

    01/26/2020, 6:34 AM
    This message was deleted.
    s
    r
    2 replies · 3 participants
  • c

    cesards

    01/27/2020, 4:17 AM
    I tried by using Hikari (used by Google in their samples to connect a client to Cloud SQL, but I got nothing. I think it might be related to the fact the driver relies on Jetty and I’m deploying the ktor backend via appengine, who relying on`io.ktor.server.servlet.ServletApplicationEngine`. I don’t have plenty experience on the backend side of things, I’m not sure what I just said makes sense to you. I might mention this in the ktor channel as well.
    t
    1 reply · 2 participants
  • r

    Ray Eldath

    01/28/2020, 4:24 PM
    hey everyone. is there anyone who met exception
    Invalid argument value: <http://java.io|java.io>.NotSerializableException. Statement(s): null
    when using Exposed DAO? i got this when tried to create
    val created = User.new {
        username = "Ray Eldath"
        email = "<mailto:xxx@xxx.com|xxx@xxx.com>"
    }
    
    Authorization.new {
        user = created
        hashedPassword = hp.toBlob()
        role = UserRole.Root
    }
    in which
    Authorization.id
    is refer to
    User.id
    . any idea on this exception? many thanks. 🙃
    e
    4 replies · 2 participants
  • e

    Egor Babarykin

    01/29/2020, 3:43 PM
    Hi Can i create dao class (entity) for ordinary table (not IdTable)? Table definition:
    object EventTable : Table("event") {
    
        val id: Column<String> = varchar("id", 255)
        val eventType: Column<EventType> = enumerationByName("type", 255, EventType::class)
    
        val event: Column<Event> = jsonb("event", objectMapper)
    
        override val primaryKey = PrimaryKey(id, eventType)
    }
    t
    3 replies · 2 participants
  • t

    Timur Atakishiev

    01/30/2020, 8:53 AM
    Hi huys, I am a bit confusing, I am trying to use BatchInsert in exposed, however amount of insert that loger shows are equals to the size of collection that I am trying to insert. I visited https://github.com/JetBrains/Exposed/issues/617 and still could not get answer, what should I do in order to make work batchInsert. Is separate inserts that exposed logger shows is okay? Has someone experience with batchInsert statement?
    t
    4 replies · 2 participants
  • c

    Carter

    01/30/2020, 8:06 PM
    Further testing indicates that the Sql DSL triggers the problem, while using the Dao DSL does not. 110 seconds to insert all my data with the Sql DSL, 25 seconds with the Dao DSL.
    t
    1 reply · 2 participants
  • n

    Nikky

    01/31/2020, 10:53 AM
    can exposed verify that the db it connected to matches the schema ? i plan to use harmonica for migrations, but obviously need to make sure those migrations really work
    t
    2 replies · 2 participants
  • a

    Abby

    01/31/2020, 4:14 PM
    Is it possible to set sqlite pragma when using exposed. I tried calling exec but it throws an exception "Query returns results"
    t
    2 replies · 2 participants
  • t

    Timur Atakishiev

    02/03/2020, 8:09 AM
    Hi guys, Is there something that I can use for the following query
    update some_table set is_deleted = true where id in (:some_list)
    t
    2 replies · 2 participants
  • t

    tjohnn

    02/04/2020, 11:36 AM
    Hi, is there a way to select where some raw query match? I am looking for something like E.g
    Products.select{ whereRaw("where array_to_string('some_psql_array_column') LIKE '%search%'") }
    CC @tapac
    s
    7 replies · 2 participants
  • w

    William Skinner

    02/06/2020, 7:11 PM
    Hello! Can someone help me setup a primary key column "id" with the expression
    nextval('job_info_seq')
    t
    1 reply · 2 participants
  • n

    Neil Hart

    02/07/2020, 7:36 PM
    I have an integer database column that stores 0/1 for boolean false/true. Is there already a ColumnType configuration I can use for this? If not, should I create a new ColumnType? TIA
    t
    1 reply · 2 participants
  • s

    SackCastellon

    02/07/2020, 9:58 PM
    @tapac what is the difference between
    LiteralOp
    and
    QueryParameter
    ?
    LiteralOp
    converts the specified
    value
    to a SQL value using the specified
    columnType
    , and
    QueryParameter
    , when the query uses a prepared statement, adds a
    ?
    for each value and then injects the actual value, and when it is not prepared, just works like the
    LiteralOp
    ?
    t
    1 reply · 2 participants
  • s

    SrSouza

    02/09/2020, 1:10 PM
    Hi @tapac can I cache DAO objects, change it outside a transaction and then time to time update the changes in the DAO in de database? (cache in memory) Have someway to do that?
    t
    1 reply · 2 participants
  • e

    exidnus

    02/09/2020, 4:39 PM
    Hello. I use h2, have varchar column and want update column: concatenate current value and additional value. For example, current value of column ",1,2," and I want add "3," and get finally ",1,2,3,". I try to use code like this from documentation (but in documentation it's integer column).
    Lessons.update(where = { Lessons.id eq lessonId }) {
                with(SqlExpressionBuilder) {
                    it.update(column, column + "$entityId$ELEM_COLLECTION_SEPARATOR")
                }
            }
    But it throws exception
    Caused by: org.h2.jdbc.JdbcSQLFeatureNotSupportedException: Feature not supported: "VARCHAR +"; SQL statement:
    UPDATE LESSONS SET CAME_STUDENTS=LESSONS.CAME_STUDENTS+? WHERE LESSONS.ID = ?
    Exposed version 0.20.3. Oh, sorry to bother, I understood, that I should just use SqlExpressionBuilder.concat(column, stringLiteral("$entityId$ELEM_COLLECTION_SEPARATOR"))
    t
    1 reply · 2 participants
  • n

    Nikky

    02/11/2020, 12:25 PM
    is there any way to do
    Database.connect
    without registering the database globally ? is there a alternative to the
    ThreadLocalTransactionManager
    ?
    s
    t
    5 replies · 3 participants
  • s

    SrSouza

    02/16/2020, 11:50 AM
    Hi @tapac why I can't access the values from my DAO outside a transaction? I'm getting a exception when a try to access
    java.lang.IllegalStateException: No transaction in context.
        at org.jetbrains.exposed.sql.transactions.TransactionManager$Companion.current(TransactionApi.kt:92) ~[nations-spigot-0.1.0-SNAPSHOT-all.jar:?]
        at org.jetbrains.exposed.dao.EntityClass.warmCache(EntityClass.kt:24) ~[nations-spigot-0.1.0-SNAPSHOT-all.jar:?]
        at org.jetbrains.exposed.dao.EntityClass.testCache(EntityClass.kt:73) ~[nations-spigot-0.1.0-SNAPSHOT-all.jar:?]
        at org.jetbrains.exposed.dao.EntityClass.findById(EntityClass.kt:42) ~[nations-spigot-0.1.0-SNAPSHOT-all.jar:?]
        at org.jetbrains.exposed.dao.EntityClass.findById(EntityClass.kt:33) ~[nations-spigot-0.1.0-SNAPSHOT-all.jar:?]
        at org.jetbrains.exposed.dao.Entity.getValue(Entity.kt:55) ~[nations-spigot-0.1.0-SNAPSHOT-all.jar:?]
        at com.zentrymc.nationsapi.database.tables.Account.getSettings(Accounts.kt) ~[nations-spigot-0.1.0-SNAPSHOT-all.jar:?]
    t
    2 replies · 2 participants
  • n

    Nikky

    02/17/2020, 9:27 AM
    is there any example how to join over 3 tables in exposed? tables similar to this: https://stackoverflow.com/questions/8057656/join-over-three-tables-in-sql
    t
    1 reply · 2 participants
  • n

    Nikky

    02/17/2020, 12:02 PM
    i seemingly have issues with a latin1 collate on a mysql database, i am translating some stuff from phph (that i not fully understand) but it seems like in exposed i get the latin1 encoded strings instead of decoded to utf8 is there any options i stil need to set in exposed ?
    s
    12 replies · 2 participants
  • t

    Timur Atakishiev

    02/20/2020, 8:46 AM
    Hi all, I have a simple table called users with the following columns id bigserial primary key, age integer something like
    select max(age) from users
    How can I get the eldest users with exposed?
    s
    4 replies · 2 participants
  • t

    Timur Atakishiev

    02/21/2020, 5:08 AM
    Hi All, how can I write these query in exposed
    select *
    from users
    where age = (select max(age) from users)
    t
    t
    3 replies · 3 participants
  • j

    jackxu

    02/24/2020, 12:01 PM
    anyone who has the experience using exposed
    batchinsert
    ?
    t
    2 replies · 2 participants
  • r

    robin

    02/24/2020, 3:38 PM
    Getting some weird behavior here. I've recently introduced HikariCP as a new DataSource to make use of connection pooling. The service was running smoothly for a few days, then suddenly, any call sprayed the exception in the attached snippet all over the place. Restarting the service immediately started to do the same, only rolling it back to an earlier version without HikariCP fixed the issue. Any idea where to start looking?
    Untitled
    t
    9 replies · 2 participants
  • r

    Reuben Jacobs

    02/24/2020, 5:13 PM
    Another question - I am right now representing a JSON column in the DB as an exposed BLOB column. How can I properly insert this?
    t
    2 replies · 2 participants
  • a

    asad.awadia

    03/04/2020, 1:11 AM
    Does exposed have any performance benchmarks? Mainly around if it does multiple queries when a single query would suffice like other ORMs like active record
    t
    1 reply · 2 participants
Powered by Linen
Title
a

asad.awadia

03/04/2020, 1:11 AM
Does exposed have any performance benchmarks? Mainly around if it does multiple queries when a single query would suffice like other ORMs like active record
t

tapac

03/04/2020, 4:52 PM
Not yet, but we plan to add Exposed to https://www.techempower.com/benchmarks/
View count: 1