https://kotlinlang.org logo
Join SlackCommunities
Powered by
# jasync-sql
  • o

    oshai

    12/03/2018, 6:54 AM
    version 0.8.54 was released with some api changes, more details on changelog: https://github.com/jasync-sql/jasync-sql/blob/master/CHANGELOG.md
  • d

    dave08

    03/19/2019, 6:55 PM
    @oshai I was wondering, for parameterized queries, do you support passing
    null
    ? It isn't in the list on the Wiki...
  • o

    oshai

    03/19/2019, 6:56 PM
    Yes it is supported
    👍🏼 1
  • d

    dave08

    03/19/2019, 6:57 PM
    Maybe it should be added to https://github.com/jasync-sql/jasync-sql/wiki/MySQL-Types and https://github.com/jasync-sql/jasync-sql/wiki/PostgreSQL-Types ?
  • o

    oshai

    03/19/2019, 7:13 PM
    Yes it can be added
  • o

    oshai

    03/20/2019, 7:57 AM
    I added it.
  • o

    oshai

    03/21/2019, 7:16 PM

    https://youtu.be/DvO4zLVDkMs▾

  • d

    dave08

    07/14/2019, 3:19 PM
    Hi @oshai! What do you think about having RowData functions that throw a "column not existing" exception (with the id provided by the user) instead of returning null? It doesn't seem to Kotlinish to have to do
    it.getInt(0)!!
    etc... and also it would only cause a Null exception instead of something more meaningful...
  • d

    dave08

    07/14/2019, 3:23 PM
    The current implementation is useful for providing defaults like
    it.getInt(0) ?: 0
    , but maybe there could be some other name for such an implementation?
    o
    • 2
    • 3
  • d

    Derek Berner

    07/15/2019, 3:21 PM
    So, the rowsets appear to be synchronous. Does that mean that a query only returns when all rows have been received from the database?
  • o

    oshai

    07/15/2019, 3:34 PM
    Yes, that is the current implementation
  • d

    Derek Berner

    07/15/2019, 3:42 PM
    Are there plans to make that more cursor-like to reduce memory footprint and data throughput?
  • o

    oshai

    07/15/2019, 6:07 PM
    I dont have plans like that at the moment, but I am open to discuss that. I think its best to open an issue on github
  • d

    Derek Berner

    07/15/2019, 6:32 PM
    👍
  • v

    v0ldem0rt

    08/05/2019, 1:24 PM
    Can jasync do some basic object mapping like JDBI (any project I am unaware of).
    o
    • 2
    • 1
  • v

    v0ldem0rt

    12/14/2019, 3:24 PM
    What are the missing features when comparing HikariCP to jasync-sql connection pooling?
    o
    • 2
    • 1
  • j

    james

    02/03/2020, 8:12 PM
    Are there any plans to add support for SQL server to jasync? JDBC does support a SQL server driver
    o
    • 2
    • 2
  • d

    dave08

    04/05/2020, 3:42 PM
    Hi! It might be nice to add more specific failure types to
    QueryResult
    like if a Unique index was violated (maybe a setting to get an exception for that...?). Currently there's no real way to distinguish a generic failure in doing an insert, or a more specific one (unless we parse the error message?) @oshai?
    o
    • 2
    • 4
  • o

    obobo

    04/06/2020, 2:05 PM
    Hi, do you know of any circumstances in which the jasync-sql exceeds the number of connections you defined in the pool? We're using postgres and occasionally we see this behavior.
    o
    • 2
    • 2
  • d

    dave08

    04/06/2020, 3:04 PM
    Another little point... if I want to use Micronaut's jasync adapter for more than one client, I would expect that I could provide many named clients under the jasync key in
    application.yaml
    ... but it seems that
    client
    is hard-coded there and doesn't allow selecting mysql/postgres type?
    o
    • 2
    • 1
  • h

    Henry

    11/21/2020, 12:36 PM
    Morning everyone, just got a new blog post up about implementing transactions with jasync-sql and Ktor, would love any feedback and hopefully someone finds it useful https://henrycourse.com/2020/11/21/jasync-sql-transactions/
    👏 1
    o
    • 2
    • 3
  • d

    dave08

    12/07/2020, 12:33 PM
    Hi! Could it be considered to log on the sql statements on the DEBUG level instead of TRACE? Netty spits out TONS of logs I don't really need... we could figure out which class outputs the logs we're interested in, but I'd suppose most users would rather this be at DEBUG, no?
    o
    • 2
    • 4
  • d

    dave08

    12/10/2020, 12:20 PM
    @oshai I think this is a little bug... one of our developers was trying to write a regex in a postgres request, and needed to use a question mark in it in a prepared statement. So Jasync reports that there's a "parameter missing", if he adds one, postgres tells him there's too many...
  • d

    dave08

    12/10/2020, 12:21 PM
    In MysqlConnection, this is how you check the amount of params
    Copy code
    val totalParameters = params.query.count { it == '?' }
    I guess it's the same in postgres, where really it should be a regex to make sure that the
    ?
    is not surrounded by quotes.
    o
    • 2
    • 16
  • d

    dave08

    10/11/2021, 2:03 PM
    Hi @oshai! Would you have any idea why we're getting this error almost for every request:
    Copy code
    2021-10-11 16:41:41	
    2021-10-11T13:41:40.969962754Z stdout F 13:41:40.969 [db-sql-netty-thread-1] INFO  c.g.j.s.d.p.c.PostgreSQLConnectionHandler - Connection disconnected - music-stats-db-postgresql.prod/10.245.137.87:5432
    2021-10-11 16:41:41	
    2021-10-11T13:41:40.968542528Z stdout F 	at java.lang.Thread.run(Thread.java:748)
    2021-10-11 16:41:41	
    2021-10-11T13:41:40.968536835Z stdout F 	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    2021-10-11 16:41:41	
    2021-10-11T13:41:40.968532063Z stdout F 	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
    2021-10-11 16:41:41	
    2021-10-11T13:41:40.96852643Z stdout F 	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
    2021-10-11 16:41:41	
    2021-10-11T13:41:40.968520689Z stdout F 	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
    2021-10-11 16:41:41	
    2021-10-11T13:41:40.968515005Z stdout F 	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
    2021-10-11 16:41:41	
    2021-10-11T13:41:40.968506767Z stdout F 	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
    2021-10-11 16:41:41	
    2021-10-11T13:41:40.968500287Z stdout F 	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151)
    2021-10-11 16:41:41	
    2021-10-11T13:41:40.968494538Z stdout F 	at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350)
    2021-10-11 16:41:41	
    2021-10-11T13:41:40.968487899Z stdout F 	at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132)
    2021-10-11 16:41:41	
    2021-10-11T13:41:40.968483161Z stdout F 	at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253)
    2021-10-11 16:41:41	
    2021-10-11T13:41:40.968477638Z stdout F 	at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379)
    2021-10-11 16:41:41	
    2021-10-11T13:41:40.968471624Z stdout F 	at sun.nio.ch.IOUtil.read(IOUtil.java:192)
    2021-10-11 16:41:41	
    2021-10-11T13:41:40.968460746Z stdout F 	at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
    2021-10-11 16:41:41	
    2021-10-11T13:41:40.968454211Z stdout F 	at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
    2021-10-11 16:41:41	
    2021-10-11T13:41:40.968448501Z stdout F 	at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
    2021-10-11 16:41:41	
    2021-10-11T13:41:40.968437547Z stdout F java.io.IOException: Connection reset by peer
    2021-10-11 16:41:41	
    2021-10-11T13:41:40.96837819Z stdout F 13:41:40.968 [db-sql-netty-thread-1] ERROR c.g.j.s.d.p.PostgreSQLConnection - Error on connection
  • d

    dave08

    10/11/2021, 2:05 PM
    Is there some kind of configuration param we might be getting wrong? Another postgres db connected to the same service with the same params works fine... and this db currently has almost no traffic on it... (it's being used for a product still in development)
  • o

    oshai

    11/18/2021, 11:06 PM
    It says
    Connection reset by peer
    - so it means the db disconnect
  • o

    oshai

    11/18/2021, 11:06 PM
    is it still relevant (over a month now)?
  • d

    dave08

    01/17/2023, 12:49 PM
    Is there a way to re-use an existing Jasync connection with an r2dbc client? Something like: https://kotlinlang.slack.com/archives/C03JF82SDHA/p1673956367718769?thread_ts=1673954851.885979&cid=C03JF82SDHA
    o
    • 2
    • 17
  • d

    dave08

    06/25/2024, 1:15 PM
    @oshai Is there a way to connect to an h2 database with postgres/mysql mode, I would rather do unit testing against an H2 database which is much faster for tests.
    o
    • 2
    • 1