https://kotlinlang.org logo
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
benchmarks
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
confetti
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
lincheck
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
Title
d

dave08

03/07/2018, 4:09 PM
If anybody was looking for an async postgres library, I just found this: https://github.com/vietj/reactive-pg-client (J. Viet is the head of the Vert.x team), I just didn't try it yet, but it looks promising... if it's based on the Vert.x version it looks stable (I have production code on the Vert.x version). It even has Kotlin docs https://www.julienviet.com/reactive-pg-client/guide/kotlin/index.html
o

orangy

03/07/2018, 4:24 PM
It has lots of dependencies on vert.x as far as I can see, which is perfectly understandable, but isn’t it kinda make it too complex to use it outside of vert.x?
d

dave08

03/07/2018, 4:33 PM
I know the Vert.x version needs to have a Vertx instance passed to it, this lib looks more independent (although you're right, I just looked at the pom file and found all those vertx dependencies...). What are your concerns about being more complex?
c

cedric

03/07/2018, 5:36 PM
I don’t really understand the point of specialized async access to db (whether the one you just listed or the new JDK effort). It’s trivial to take the current sync API and make it async with a lot of options and variety (Rx, coroutines, etc…)
o

orangy

03/07/2018, 5:42 PM
It is not. First you need to have async connection pool that is not blocking a thread. Then you need to send request to SQL server and suspend (not block) until it responds. Then, ideally, you would receive rows for the result set in an async way, like in a channel or so, and do not block thread and not fill in your RAM with all the received raws before returning it to client.
Most existing pseudo-async solutions just use secondary thread pool for sync JDBC connections.
d

dave08

03/07/2018, 5:43 PM
And all that is covered by the Vert.x client...
👍 1
I'd suppose this one too... I would just be very interested to know if I could use Ktor with it? Could there be some pitfalls involved?
f

fred.deschenes

03/07/2018, 5:45 PM
well you can't use any ORM on top of it since it doesn't use JDBC
c

cedric

03/07/2018, 5:45 PM
I see
f

fred.deschenes

03/07/2018, 5:45 PM
and from what I remember it boots a vertx server which isn't exactly lightweight
c

cedric

03/07/2018, 5:46 PM
So the real work would be at the JDBC driver level, right?
d

dave08

03/07/2018, 5:46 PM
This perticular library? @fred.deschenes
c

cedric

03/07/2018, 5:46 PM
(and database itself too obviously)
not so much at the app level?
f

fred.deschenes

03/07/2018, 5:46 PM
well any "async" SQL library (this one included)
d

dave08

03/07/2018, 5:47 PM
I mean booting full vertx? I don't think it would deploy verticles behind the scenes or anything..
f

fred.deschenes

03/07/2018, 5:47 PM
honestly until the new async JDBC (whatever they called it, can't remember) I don't think it's worth it trying to work with those libraries (although they are a good way to figure out what to do and not to do in the real async implementations that will come eventually)
d

dave08

03/07/2018, 5:49 PM
@cedric Node.js works like this too, the "event loop" of the app keeps on receiving requests and running queries, and gets responses and sends them in callbacks, effectively not blocking any threads and being able to process many more requests w/ less resources...
@fred.deschenes It all depends what you're trying to accomplish..
o

orangy

03/07/2018, 5:50 PM
We are preparing to do it for #squash as well. @Deactivated User got a prototype for MySQL, and we have a branch with suspending function, but no connection pool yet.
c

cedric

03/07/2018, 5:51 PM
Ok… squash?
d

dave08

03/07/2018, 5:51 PM
Is there some kind of idea of a release date @orangy?
c

cedric

03/07/2018, 5:52 PM
d

Deactivated User

03/07/2018, 5:54 PM
My fork (with the suspending stuff): https://github.com/soywiz/squash And the MySQL CIO client (along other clients like redis): https://github.com/soywiz/ktor-cio-clients Still WIP, but somehow works. Also those are temporal repos until merged. But I put in the case you are curious about it.
d

dave08

03/07/2018, 6:00 PM
Very interesting... 😉
That could put it ahead of #exposed ...
o

orangy

03/07/2018, 6:27 PM
suspending stuff minus other related work is in branch for squash already, but I’m not yet sure how to promote it to master. It will require after user to wrap in
runBlocking
or something similar, unless they use #ktor already of course 🙂
As for release date, I can’t say anything. This is side project for me, I can’t put a lot of effort there. I think when @Deactivated User can migrate all his korio stuff to coroutine libraries we are building for IO & network (channels, etc) we can consider making it default for squash and change it to be the async lib.
d

Deactivated User

03/07/2018, 6:46 PM
Nice. I think it is almost done modulo bugs and remaining cleanups (did some additional work last friday night by reducing GC and added some protocol-level redis tests). Of course it will require stress tests and some time of heavy use to determine that everything is working fine. But at least it is a start 🙂 and brings some of the benefits of Node.JS clients. I will check later the status of those repos, clean up the things that are already migrated to coroutines library, and see if I can publish cio clients to bintray in the meantime so the squash fork including the mysql pure async client can work. We have to see where to put those cio clients once they are done. They depend on
ktor-network
for raw sockets, that only depends on
kotlinx.coroutines
. So they should be pretty stand alone.
o

orangy

03/07/2018, 6:56 PM
We will be shuffling stuff between kotlinx.coroutines, kotlinx.io, ktor to extract useful and self-contained libs for building other stuff in the Kotlin ecosystem.
d

dave08

03/07/2018, 7:07 PM
Sounds great!
g

gregopet

03/21/2018, 11:45 AM
I tried using the impossibl Postgres driver (https://github.com/impossibl/pgjdbc-ng)
Supposedly it is built on much better principles than the standard PG driver
It turned out however that the standard PG driver is so well fine-tuned that it still beats Impossibl at performance
On top of that, the standard driver's bugs are well understood by any software you're using to access the database (jOOQ in my case), while alt drivers are not
At the time, the jOOQ author advised me to just wait and stick with the standard driver for the time being
o

orangy

03/21/2018, 1:05 PM
Wait for sql2
Yes, that’s what I see all the time when I ask about async sql