Exposed - Exposed, an ORM framework for Kotlin.

Overview

Exposed

JetBrains team project Kotlinlang Slack Channel TC Build status Maven Central GitHub License

Welcome to Exposed, an ORM framework for Kotlin. Exposed offers two levels of database access: typesafe SQL wrapping DSL and lightweight data access objects. Our official mascot is Cuttlefish, which is best known for its outstanding mimicry abilities letting it blend seamlessly in any environment. Just like our mascot, Exposed can mimic a variety of database engines and help you build database applications without hard dependencies on any specific database engine, and switch between them with very little or no changes in your code.

Supported Databases

Links

Exposed is currently available for maven/gradle builds at Maven Central (read Getting started).

  • Wiki with examples and docs.
  • Roadmap to see what's coming next.
  • Change log of improvements and bug fixes.

If you have any questions feel free to ask at our #exposed channel on kotlinlang.slack.com.

Examples

SQL DSL

val name = varchar("name", length = 50) // Column val cityId = (integer("city_id") references Cities.id).nullable() // Column override val primaryKey = PrimaryKey(id, name = "PK_User_ID") // name is optional here } object Cities : Table() { val id = integer("id").autoIncrement() // Column val name = varchar("name", 50) // Column override val primaryKey = PrimaryKey(id, name = "PK_Cities_ID") } fun main() { Database.connect("jdbc:h2:mem:test", driver = "org.h2.Driver", user = "root", password = "") transaction { addLogger(StdOutSqlLogger) SchemaUtils.create (Cities, Users) val saintPetersburgId = Cities.insert { it[name] = "St. Petersburg" } get Cities.id val munichId = Cities.insert { it[name] = "Munich" } get Cities.id val pragueId = Cities.insert { it.update(name, stringLiteral(" Prague ").trim().substring(1, 2)) }[Cities.id] val pragueName = Cities.select { Cities.id eq pragueId }.single()[Cities.name] assertEquals(pragueName, "Pr") Users.insert { it[id] = "andrey" it[name] = "Andrey" it[Users.cityId] = saintPetersburgId } Users.insert { it[id] = "sergey" it[name] = "Sergey" it[Users.cityId] = munichId } Users.insert { it[id] = "eugene" it[name] = "Eugene" it[Users.cityId] = munichId } Users.insert { it[id] = "alex" it[name] = "Alex" it[Users.cityId] = null } Users.insert { it[id] = "smth" it[name] = "Something" it[Users.cityId] = null } Users.update({ Users.id eq "alex"}) { it[name] = "Alexey" } Users.deleteWhere{ Users.name like "%thing"} println("All cities:") for (city in Cities.selectAll()) { println("${city[Cities.id]}: ${city[Cities.name]}") } println("Manual join:") (Users innerJoin Cities).slice(Users.name, Cities.name). select {(Users.id.eq("andrey") or Users.name.eq("Sergey")) and Users.id.eq("sergey") and Users.cityId.eq(Cities.id)}.forEach { println("${it[Users.name]} lives in ${it[Cities.name]}") } println("Join with foreign key:") (Users innerJoin Cities).slice(Users.name, Users.cityId, Cities.name). select { Cities.name.eq("St. Petersburg") or Users.cityId.isNull()}.forEach { if (it[Users.cityId] != null) { println("${it[Users.name]} lives in ${it[Cities.name]}") } else { println("${it[Users.name]} lives nowhere") } } println("Functions and group by:") ((Cities innerJoin Users).slice(Cities.name, Users.id.count()).selectAll().groupBy(Cities.name)).forEach { val cityName = it[Cities.name] val userCount = it[Users.id.count()] if (userCount > 0) { println("$userCount user(s) live(s) in $cityName") } else { println("Nobody lives in $cityName") } } SchemaUtils.drop (Users, Cities) } } ">
import org.jetbrains.exposed.sql.*
import org.jetbrains.exposed.sql.transactions.transaction

object Users : Table() {
    val id = varchar("id", 10) // Column
       
    val name = varchar("name", length = 50) // Column
       
    val cityId = (integer("city_id") references Cities.id).nullable() // Column
       

    override val primaryKey = PrimaryKey(id, name = "PK_User_ID") // name is optional here
}

object Cities : Table() {
    val id = integer("id").autoIncrement() // Column
       
    val name = varchar("name", 50) // Column
       

    override val primaryKey = PrimaryKey(id, name = "PK_Cities_ID")
}

fun main() {
    Database.connect("jdbc:h2:mem:test", driver = "org.h2.Driver", user = "root", password = "")

    transaction {
        addLogger(StdOutSqlLogger)

        SchemaUtils.create (Cities, Users)

        val saintPetersburgId = Cities.insert {
            it[name] = "St. Petersburg"
        } get Cities.id

        val munichId = Cities.insert {
            it[name] = "Munich"
        } get Cities.id

        val pragueId = Cities.insert {
            it.update(name, stringLiteral("   Prague   ").trim().substring(1, 2))
        }[Cities.id]

        val pragueName = Cities.select { Cities.id eq pragueId }.single()[Cities.name]
        assertEquals(pragueName, "Pr")

        Users.insert {
            it[id] = "andrey"
            it[name] = "Andrey"
            it[Users.cityId] = saintPetersburgId
        }

        Users.insert {
            it[id] = "sergey"
            it[name] = "Sergey"
            it[Users.cityId] = munichId
        }

        Users.insert {
            it[id] = "eugene"
            it[name] = "Eugene"
            it[Users.cityId] = munichId
        }

        Users.insert {
            it[id] = "alex"
            it[name] = "Alex"
            it[Users.cityId] = null
        }

        Users.insert {
            it[id] = "smth"
            it[name] = "Something"
            it[Users.cityId] = null
        }

        Users.update({ Users.id eq "alex"}) {
            it[name] = "Alexey"
        }

        Users.deleteWhere{ Users.name like "%thing"}

        println("All cities:")

        for (city in Cities.selectAll()) {
            println("${city[Cities.id]}: ${city[Cities.name]}")
        }

        println("Manual join:")
        (Users innerJoin Cities).slice(Users.name, Cities.name).
            select {(Users.id.eq("andrey") or Users.name.eq("Sergey")) and
                    Users.id.eq("sergey") and Users.cityId.eq(Cities.id)}.forEach {
            println("${it[Users.name]} lives in ${it[Cities.name]}")
        }

        println("Join with foreign key:")


        (Users innerJoin Cities).slice(Users.name, Users.cityId, Cities.name).
                select { Cities.name.eq("St. Petersburg") or Users.cityId.isNull()}.forEach {
            if (it[Users.cityId] != null) {
                println("${it[Users.name]} lives in ${it[Cities.name]}")
            }
            else {
                println("${it[Users.name]} lives nowhere")
            }
        }

        println("Functions and group by:")

        ((Cities innerJoin Users).slice(Cities.name, Users.id.count()).selectAll().groupBy(Cities.name)).forEach {
            val cityName = it[Cities.name]
            val userCount = it[Users.id.count()]

            if (userCount > 0) {
                println("$userCount user(s) live(s) in $cityName")
            } else {
                println("Nobody lives in $cityName")
            }
        }

        SchemaUtils.drop (Users, Cities)
    }
}

Generated SQL:

    SQL: CREATE TABLE IF NOT EXISTS Cities (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(50) NOT NULL, CONSTRAINT PK_Cities_ID PRIMARY KEY (id))
    SQL: CREATE TABLE IF NOT EXISTS Users (id VARCHAR(10) NOT NULL, name VARCHAR(50) NOT NULL, city_id INT NULL, CONSTRAINT PK_User_ID PRIMARY KEY (id))
    SQL: ALTER TABLE Users ADD FOREIGN KEY (city_id) REFERENCES Cities(id)
    SQL: INSERT INTO Cities (name) VALUES ('St. Petersburg')
    SQL: INSERT INTO Cities (name) VALUES ('Munich')
    SQL: INSERT INTO Cities (name) VALUES ('Prague')
    SQL: INSERT INTO Users (id, name, city_id) VALUES ('andrey', 'Andrey', 1)
    SQL: INSERT INTO Users (id, name, city_id) VALUES ('sergey', 'Sergey', 2)
    SQL: INSERT INTO Users (id, name, city_id) VALUES ('eugene', 'Eugene', 2)
    SQL: INSERT INTO Users (id, name, city_id) VALUES ('alex', 'Alex', NULL)
    SQL: INSERT INTO Users (id, name, city_id) VALUES ('smth', 'Something', NULL)
    SQL: UPDATE Users SET name='Alexey' WHERE Users.id = 'alex'
    SQL: DELETE FROM Users WHERE Users.name LIKE '%thing'
    All cities:
    SQL: SELECT Cities.id, Cities.name FROM Cities
    1: St. Petersburg
    2: Munich
    3: Prague
    Manual join:
    SQL: SELECT Users.name, Cities.name FROM Users INNER JOIN Cities ON Cities.id = Users.city_id WHERE ((Users.id = 'andrey') or (Users.name = 'Sergey')) and Users.id = 'sergey' and Users.city_id = Cities.id
    Sergey lives in Munich
    Join with foreign key:
    SQL: SELECT Users.name, Users.city_id, Cities.name FROM Users INNER JOIN Cities ON Cities.id = Users.city_id WHERE (Cities.name = 'St. Petersburg') or (Users.city_id IS NULL)
    Andrey lives in St. Petersburg
    Functions and group by:
    SQL: SELECT Cities.name, COUNT(Users.id) FROM Cities INNER JOIN Users ON Cities.id = Users.city_id GROUP BY Cities.name
    1 user(s) live(s) in St. Petersburg
    2 user(s) live(s) in Munich
    SQL: DROP TABLE Users
    SQL: DROP TABLE Cities

DAO

) : IntEntity(id) { companion object : IntEntityClass (Users) var name by Users.name var city by City referencedOn Users.city var age by Users.age } class City(id: EntityID ) : IntEntity(id) { companion object : IntEntityClass (Cities) var name by Cities.name val users by User referrersOn Users.city } fun main() { Database.connect("jdbc:h2:mem:test", driver = "org.h2.Driver", user = "root", password = "") transaction { addLogger(StdOutSqlLogger) SchemaUtils.create (Cities, Users) val stPete = City.new { name = "St. Petersburg" } val munich = City.new { name = "Munich" } User.new { name = "a" city = stPete age = 5 } User.new { name = "b" city = stPete age = 27 } User.new { name = "c" city = munich age = 42 } println("Cities: ${City.all().joinToString {it.name}}") println("Users in ${stPete.name}: ${stPete.users.joinToString {it.name}}") println("Adults: ${User.find { Users.age greaterEq 18 }.joinToString {it.name}}") } } ">
import org.jetbrains.exposed.dao.*
import org.jetbrains.exposed.dao.id.EntityID
import org.jetbrains.exposed.dao.id.IntIdTable
import org.jetbrains.exposed.sql.*
import org.jetbrains.exposed.sql.transactions.transaction

object Users : IntIdTable() {
    val name = varchar("name", 50).index()
    val city = reference("city", Cities)
    val age = integer("age")
}

object Cities: IntIdTable() {
    val name = varchar("name", 50)
}

class User(id: EntityID<Int>) : IntEntity(id) {
    companion object : IntEntityClass<User>(Users)

    var name by Users.name
    var city by City referencedOn Users.city
    var age by Users.age
}

class City(id: EntityID<Int>) : IntEntity(id) {
    companion object : IntEntityClass<City>(Cities)

    var name by Cities.name
    val users by User referrersOn Users.city
}

fun main() {
    Database.connect("jdbc:h2:mem:test", driver = "org.h2.Driver", user = "root", password = "")

    transaction {
        addLogger(StdOutSqlLogger)

        SchemaUtils.create (Cities, Users)

        val stPete = City.new {
            name = "St. Petersburg"
        }

        val munich = City.new {
            name = "Munich"
        }

        User.new {
            name = "a"
            city = stPete
            age = 5
        }

        User.new {
            name = "b"
            city = stPete
            age = 27
        }

        User.new {
            name = "c"
            city = munich
            age = 42
        }

        println("Cities: ${City.all().joinToString {it.name}}")
        println("Users in ${stPete.name}: ${stPete.users.joinToString {it.name}}")
        println("Adults: ${User.find { Users.age greaterEq 18 }.joinToString {it.name}}")
    }
}

Generated SQL:

    SQL: CREATE TABLE IF NOT EXISTS Cities (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(50) NOT NULL, CONSTRAINT pk_Cities PRIMARY KEY (id))
    SQL: CREATE TABLE IF NOT EXISTS Users (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(50) NOT NULL, city INT NOT NULL, age INT NOT NULL, CONSTRAINT pk_Users PRIMARY KEY (id))
    SQL: CREATE INDEX Users_name ON Users (name)
    SQL: ALTER TABLE Users ADD FOREIGN KEY (city) REFERENCES Cities(id)
    SQL: INSERT INTO Cities (name) VALUES ('St. Petersburg'),('Munich')
    SQL: SELECT Cities.id, Cities.name FROM Cities
    Cities: St. Petersburg, Munich
    SQL: INSERT INTO Users (name, city, age) VALUES ('a', 1, 5),('b', 1, 27),('c', 2, 42)
    SQL: SELECT Users.id, Users.name, Users.city, Users.age FROM Users WHERE Users.city = 1
    Users in St. Petersburg: a, b
    SQL: SELECT Users.id, Users.name, Users.city, Users.age FROM Users WHERE Users.age >= 18
    Adults: b, c

License

Apache License, Version 2.0, (LICENSE or https://www.apache.org/licenses/LICENSE-2.0)

Comments
  • Leaking conection with hikari and postgres

    Leaking conection with hikari and postgres

    Using: exposed 0.12.1, PG 42.2.5, hikari 3.2.0

    The way I run transaction:

    private fun <T> runWithinTransaction(db: Database, block: () -> T): T {
            return transaction(db) {
                addLogger(Slf4jSqlDebugLogger)
                warnLongQueriesDuration = 2000
                connection.prepareStatement("SET LOCAL statement_timeout TO 1").use {
                    it.execute()
                }
                block()
            }
        }
    

    I've set it to 1ms by design in test, so I can achieve in shorter time same what happen on prod with longer timeouts.

    "DefaultDispatcher-worker-4 @request#72" #34 daemon prio=5 os_prio=31 tid=0x00007fdfd9acb800 nid=0x5e07 runnable [0x0000700011556000]
       java.lang.Thread.State: RUNNABLE
            at java.net.SocketInputStream.socketRead0(Native Method)
            at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
            at java.net.SocketInputStream.read(SocketInputStream.java:171)
            at java.net.SocketInputStream.read(SocketInputStream.java:141)
            at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:140)
            at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:109)
            at org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:67)
            at org.postgresql.core.PGStream.receiveChar(PGStream.java:306)
            at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1952)
            at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
            - locked <0x000000076f80c298> (a org.postgresql.core.v3.QueryExecutorImpl)
            at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
            at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
            at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307)
            at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293)
            at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270)
            at org.postgresql.jdbc.PgStatement.executeQuery(PgStatement.java:224)
            at org.postgresql.jdbc.PgDatabaseMetaData.getSQLKeywords(PgDatabaseMetaData.java:320)
            at org.jetbrains.exposed.sql.Database$keywords$2.invoke(Database.kt:42)
            at org.jetbrains.exposed.sql.Database$keywords$2.invoke(Database.kt:16)
            at kotlin.UnsafeLazyImpl.getValue(Lazy.kt:81)
            at org.jetbrains.exposed.sql.Database.getKeywords(Database.kt)
            at org.jetbrains.exposed.sql.Database.needQuotes(Database.kt:57)
            at org.jetbrains.exposed.sql.Transaction.quoteTokenIfNecessary(Transaction.kt:164)
            at org.jetbrains.exposed.sql.Transaction.quoteIfNecessary$exposed(Transaction.kt:158)
            at org.jetbrains.exposed.sql.Transaction.fullIdentity(Transaction.kt:170)
            at org.jetbrains.exposed.sql.Column.toSQL(Column.kt:32)
            at org.jetbrains.exposed.sql.Query$prepareSQL$$inlined$buildString$lambda$1.invoke(Query.kt:169)
            at org.jetbrains.exposed.sql.Query$prepareSQL$$inlined$buildString$lambda$1.invoke(Query.kt:84)
            at kotlin.text.StringsKt__StringBuilderKt.appendElement(StringBuilder.kt:58)
            at kotlin.collections.CollectionsKt___CollectionsKt.joinTo(_Collections.kt:2274)
            at kotlin.collections.CollectionsKt___CollectionsKt.joinToString(_Collections.kt:2291)
            at kotlin.collections.CollectionsKt___CollectionsKt.joinToString$default(_Collections.kt:2290)
            at org.jetbrains.exposed.sql.Query.prepareSQL(Query.kt:169)
            at org.jetbrains.exposed.sql.Query.arguments(Query.kt:153)
            at org.jetbrains.exposed.sql.Query.arguments(Query.kt:84)
            at org.jetbrains.exposed.sql.statements.Statement.executeIn$exposed(Statement.kt:32)
            at org.jetbrains.exposed.sql.Transaction.exec(Transaction.kt:131)
            at org.jetbrains.exposed.sql.Transaction.exec(Transaction.kt:125)
            at org.jetbrains.exposed.sql.Query.iterator(Query.kt:291)
    
    

    Any suggestion what may cause it?

    Additionally, is there any other way to set query timeout ?

    opened by spolnik 24
  • Multiple databases

    Multiple databases

    Can I use multiple connection? Can I use something like this?

    val db1 = Database.connect("jdbc:h2:dbfile1", "org.h2.Driver")
    val db2 = Database.connect("jdbc:h2:dbfile2", "org.h2.Driver")
    
    db1.transaction {
        // working with the first database
    }
    
    db2.transaction {
        // working with the second database
    }
    

    I have read the source and if I understand I can use separate bases in separate threads. Like this.

    // thread 1
    Database.connect("jdbc:h2:dbfile1", "org.h2.Driver")
    transaction { // first db }
    
    // thread 2
    Database.connect("jdbc:h2:dbfile2", "org.h2.Driver")
    transaction { // second db }
    

    That's right?

    enhancement documentation 
    opened by dakuenjery 22
  • Too many warnings related to cleanup

    Too many warnings related to cleanup

    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
    Feb 13, 2021 5:28:37 PM com.impossibl.postgres.jdbc.ThreadedHousekeeper$HousekeeperReference cleanup
    WARNING: Cleaning up leaked result-set
    Allocation occurred @
      at org.jetbrains.exposed.sql.statements.jdbc.JdbcPreparedStatementImpl.executeQuery(JdbcPreparedStatementImpl.kt:21)
      at org.jetbrains.exposed.sql.Query.executeInternal(Query.kt:79)
      at org.jetbrains.exposed.sql.Query.executeInternal(Query.kt:15)
      at org.jetbrains.exposed.sql.statements.Statement.executeIn$exposed_core(Statement.kt:61)
      at org.jetbrains.exposed.sql.Transaction.exec(Transaction.kt:129)
      at org.jetbrains.exposed.sql.Query.count(Query.kt:251)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis$getAllCompanies$1.invoke(CompanyOwnerApis.kt:217)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis$getAllCompanies$1.invoke(CompanyOwnerApis.kt:13)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$inTopLevelTransaction$1.invoke(ThreadLocalTransactionManager.kt:170)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$inTopLevelTransaction$2.invoke(ThreadLocalTransactionManager.kt:191)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:199)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.inTopLevelTransaction(ThreadLocalTransactionManager.kt:190)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$transaction$1.invoke(ThreadLocalTransactionManager.kt:148)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:199)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:120)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:118)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction$default(ThreadLocalTransactionManager.kt:117)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis.getAllCompanies(CompanyOwnerApis.kt:213)
      at tech.tarunchawla.server.Gateway.getOwnerCompanies(Gateway.kt:101)
      at tech.tarunchawla.server.KtorApplicationConfigKt$module$5$7$5.invokeSuspend(KtorApplicationConfig.kt:103)
      at tech.tarunchawla.server.KtorApplicationConfigKt$module$5$7$5.invoke(KtorApplicationConfig.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:188)
      at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:31)
      at io.ktor.routing.Routing.executeResult(Routing.kt:147)
      at io.ktor.routing.Routing.interceptor(Routing.kt:34)
      at io.ktor.routing.Routing$Feature$install$1.invokeSuspend(Routing.kt:99)
      at io.ktor.routing.Routing$Feature$install$1.invoke(Routing.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.features.ContentNegotiation$Feature$install$1.invokeSuspend(ContentNegotiation.kt:107)
      at io.ktor.features.ContentNegotiation$Feature$install$1.invoke(ContentNegotiation.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.features.StatusPages$interceptCall$2.invokeSuspend(StatusPages.kt:101)
      at io.ktor.features.StatusPages$interceptCall$2.invoke(StatusPages.kt)
      at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:91)
      at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:194)
      at io.ktor.features.StatusPages.interceptCall(StatusPages.kt:100)
      at io.ktor.features.StatusPages$Feature$install$2.invokeSuspend(StatusPages.kt:140)
      at io.ktor.features.StatusPages$Feature$install$2.invoke(StatusPages.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:188)
      at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:31)
      at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invokeSuspend(DefaultEnginePipeline.kt:121)
      at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invoke(DefaultEnginePipeline.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:188)
      at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:31)
      at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.invokeSuspend(NettyApplicationCallHandler.kt:40)
      at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.invoke(NettyApplicationCallHandler.kt)
      at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(Undispatched.kt:55)
      at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:111)
      at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:158)
      at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
      at kotlinx.coroutines.BuildersKt.launch(Unknown Source)
      at io.ktor.server.netty.NettyApplicationCallHandler.handleRequest(NettyApplicationCallHandler.kt:30)
      at io.ktor.server.netty.NettyApplicationCallHandler.channelRead(NettyApplicationCallHandler.kt:24)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
      at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:61)
      at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:370)
      at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
      at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
      at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
      at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
      at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
      at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
      at java.base/java.lang.Thread.run(Thread.java:832)
    
    Feb 13, 2021 5:28:37 PM com.impossibl.postgres.jdbc.ThreadedHousekeeper$HousekeeperReference cleanup
    WARNING: Cleaning up leaked result-set
    Allocation occurred @
      at org.jetbrains.exposed.sql.statements.jdbc.JdbcPreparedStatementImpl.executeQuery(JdbcPreparedStatementImpl.kt:21)
      at org.jetbrains.exposed.sql.Query.executeInternal(Query.kt:79)
      at org.jetbrains.exposed.sql.Query.executeInternal(Query.kt:15)
      at org.jetbrains.exposed.sql.statements.Statement.executeIn$exposed_core(Statement.kt:61)
      at org.jetbrains.exposed.sql.Transaction.exec(Transaction.kt:129)
      at org.jetbrains.exposed.sql.Query.count(Query.kt:251)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis$getCompanyDetails$1.invoke(CompanyOwnerApis.kt:240)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis$getCompanyDetails$1.invoke(CompanyOwnerApis.kt:13)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$transaction$1.invoke(ThreadLocalTransactionManager.kt:128)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:199)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:120)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:118)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction$default(ThreadLocalTransactionManager.kt:117)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis.getCompanyDetails(CompanyOwnerApis.kt:236)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis$getAllCompanies$1.invoke(CompanyOwnerApis.kt:221)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis$getAllCompanies$1.invoke(CompanyOwnerApis.kt:13)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$inTopLevelTransaction$1.invoke(ThreadLocalTransactionManager.kt:170)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$inTopLevelTransaction$2.invoke(ThreadLocalTransactionManager.kt:191)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:199)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.inTopLevelTransaction(ThreadLocalTransactionManager.kt:190)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$transaction$1.invoke(ThreadLocalTransactionManager.kt:148)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:199)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:120)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:118)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction$default(ThreadLocalTransactionManager.kt:117)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis.getAllCompanies(CompanyOwnerApis.kt:213)
      at tech.tarunchawla.server.Gateway.getOwnerCompanies(Gateway.kt:101)
      at tech.tarunchawla.server.KtorApplicationConfigKt$module$5$7$5.invokeSuspend(KtorApplicationConfig.kt:103)
      at tech.tarunchawla.server.KtorApplicationConfigKt$module$5$7$5.invoke(KtorApplicationConfig.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:188)
      at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:31)
      at io.ktor.routing.Routing.executeResult(Routing.kt:147)
      at io.ktor.routing.Routing.interceptor(Routing.kt:34)
      at io.ktor.routing.Routing$Feature$install$1.invokeSuspend(Routing.kt:99)
      at io.ktor.routing.Routing$Feature$install$1.invoke(Routing.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.features.ContentNegotiation$Feature$install$1.invokeSuspend(ContentNegotiation.kt:107)
      at io.ktor.features.ContentNegotiation$Feature$install$1.invoke(ContentNegotiation.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.features.StatusPages$interceptCall$2.invokeSuspend(StatusPages.kt:101)
      at io.ktor.features.StatusPages$interceptCall$2.invoke(StatusPages.kt)
      at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:91)
      at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:194)
      at io.ktor.features.StatusPages.interceptCall(StatusPages.kt:100)
      at io.ktor.features.StatusPages$Feature$install$2.invokeSuspend(StatusPages.kt:140)
      at io.ktor.features.StatusPages$Feature$install$2.invoke(StatusPages.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:188)
      at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:31)
      at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invokeSuspend(DefaultEnginePipeline.kt:121)
      at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invoke(DefaultEnginePipeline.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:188)
      at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:31)
      at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.invokeSuspend(NettyApplicationCallHandler.kt:40)
      at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.invoke(NettyApplicationCallHandler.kt)
      at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(Undispatched.kt:55)
      at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:111)
      at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:158)
      at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
      at kotlinx.coroutines.BuildersKt.launch(Unknown Source)
      at io.ktor.server.netty.NettyApplicationCallHandler.handleRequest(NettyApplicationCallHandler.kt:30)
      at io.ktor.server.netty.NettyApplicationCallHandler.channelRead(NettyApplicationCallHandler.kt:24)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
      at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:61)
      at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:370)
      at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
      at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
      at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
      at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
      at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
      at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
      at java.base/java.lang.Thread.run(Thread.java:832)
    
    Feb 13, 2021 5:28:37 PM com.impossibl.postgres.jdbc.ThreadedHousekeeper$HousekeeperReference cleanup
    WARNING: Cleaning up leaked result-set
    Allocation occurred @
      at org.jetbrains.exposed.sql.statements.jdbc.JdbcPreparedStatementImpl.executeQuery(JdbcPreparedStatementImpl.kt:21)
      at org.jetbrains.exposed.sql.Query.executeInternal(Query.kt:79)
      at org.jetbrains.exposed.sql.Query.executeInternal(Query.kt:15)
      at org.jetbrains.exposed.sql.statements.Statement.executeIn$exposed_core(Statement.kt:61)
      at org.jetbrains.exposed.sql.Transaction.exec(Transaction.kt:129)
      at org.jetbrains.exposed.sql.Query.count(Query.kt:251)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis$getCompanyDetails$1.invoke(CompanyOwnerApis.kt:248)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis$getCompanyDetails$1.invoke(CompanyOwnerApis.kt:13)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$transaction$1.invoke(ThreadLocalTransactionManager.kt:128)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:199)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:120)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:118)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction$default(ThreadLocalTransactionManager.kt:117)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis.getCompanyDetails(CompanyOwnerApis.kt:236)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis$getAllCompanies$1.invoke(CompanyOwnerApis.kt:221)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis$getAllCompanies$1.invoke(CompanyOwnerApis.kt:13)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$inTopLevelTransaction$1.invoke(ThreadLocalTransactionManager.kt:170)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$inTopLevelTransaction$2.invoke(ThreadLocalTransactionManager.kt:191)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:199)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.inTopLevelTransaction(ThreadLocalTransactionManager.kt:190)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$transaction$1.invoke(ThreadLocalTransactionManager.kt:148)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:199)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:120)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:118)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction$default(ThreadLocalTransactionManager.kt:117)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis.getAllCompanies(CompanyOwnerApis.kt:213)
      at tech.tarunchawla.server.Gateway.getOwnerCompanies(Gateway.kt:101)
      at tech.tarunchawla.server.KtorApplicationConfigKt$module$5$7$5.invokeSuspend(KtorApplicationConfig.kt:103)
      at tech.tarunchawla.server.KtorApplicationConfigKt$module$5$7$5.invoke(KtorApplicationConfig.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:188)
      at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:31)
      at io.ktor.routing.Routing.executeResult(Routing.kt:147)
      at io.ktor.routing.Routing.interceptor(Routing.kt:34)
      at io.ktor.routing.Routing$Feature$install$1.invokeSuspend(Routing.kt:99)
      at io.ktor.routing.Routing$Feature$install$1.invoke(Routing.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.features.ContentNegotiation$Feature$install$1.invokeSuspend(ContentNegotiation.kt:107)
      at io.ktor.features.ContentNegotiation$Feature$install$1.invoke(ContentNegotiation.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.features.StatusPages$interceptCall$2.invokeSuspend(StatusPages.kt:101)
      at io.ktor.features.StatusPages$interceptCall$2.invoke(StatusPages.kt)
      at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:91)
      at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:194)
      at io.ktor.features.StatusPages.interceptCall(StatusPages.kt:100)
      at io.ktor.features.StatusPages$Feature$install$2.invokeSuspend(StatusPages.kt:140)
      at io.ktor.features.StatusPages$Feature$install$2.invoke(StatusPages.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:188)
      at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:31)
      at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invokeSuspend(DefaultEnginePipeline.kt:121)
      at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invoke(DefaultEnginePipeline.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:188)
      at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:31)
      at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.invokeSuspend(NettyApplicationCallHandler.kt:40)
      at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.invoke(NettyApplicationCallHandler.kt)
      at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(Undispatched.kt:55)
      at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:111)
      at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:158)
      at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
      at kotlinx.coroutines.BuildersKt.launch(Unknown Source)
      at io.ktor.server.netty.NettyApplicationCallHandler.handleRequest(NettyApplicationCallHandler.kt:30)
      at io.ktor.server.netty.NettyApplicationCallHandler.channelRead(NettyApplicationCallHandler.kt:24)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
      at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:61)
      at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:370)
      at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
      at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
      at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
      at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
      at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
      at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
      at java.base/java.lang.Thread.run(Thread.java:832)
    
    Feb 13, 2021 5:28:37 PM com.impossibl.postgres.jdbc.ThreadedHousekeeper$HousekeeperReference cleanup
    WARNING: Cleaning up leaked result-set
    Allocation occurred @
      at org.jetbrains.exposed.sql.statements.jdbc.JdbcPreparedStatementImpl.executeQuery(JdbcPreparedStatementImpl.kt:21)
      at org.jetbrains.exposed.sql.Query.executeInternal(Query.kt:79)
      at org.jetbrains.exposed.sql.Query.executeInternal(Query.kt:15)
      at org.jetbrains.exposed.sql.statements.Statement.executeIn$exposed_core(Statement.kt:61)
      at org.jetbrains.exposed.sql.Transaction.exec(Transaction.kt:129)
      at org.jetbrains.exposed.sql.Query.count(Query.kt:251)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis$getCompanyDetails$1.invoke(CompanyOwnerApis.kt:240)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis$getCompanyDetails$1.invoke(CompanyOwnerApis.kt:13)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$transaction$1.invoke(ThreadLocalTransactionManager.kt:128)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:199)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:120)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:118)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction$default(ThreadLocalTransactionManager.kt:117)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis.getCompanyDetails(CompanyOwnerApis.kt:236)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis$getAllCompanies$1.invoke(CompanyOwnerApis.kt:221)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis$getAllCompanies$1.invoke(CompanyOwnerApis.kt:13)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$inTopLevelTransaction$1.invoke(ThreadLocalTransactionManager.kt:170)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$inTopLevelTransaction$2.invoke(ThreadLocalTransactionManager.kt:191)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:199)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.inTopLevelTransaction(ThreadLocalTransactionManager.kt:190)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$transaction$1.invoke(ThreadLocalTransactionManager.kt:148)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:199)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:120)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:118)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction$default(ThreadLocalTransactionManager.kt:117)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis.getAllCompanies(CompanyOwnerApis.kt:213)
      at tech.tarunchawla.server.Gateway.getOwnerCompanies(Gateway.kt:101)
      at tech.tarunchawla.server.KtorApplicationConfigKt$module$5$7$5.invokeSuspend(KtorApplicationConfig.kt:103)
      at tech.tarunchawla.server.KtorApplicationConfigKt$module$5$7$5.invoke(KtorApplicationConfig.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:188)
      at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:31)
      at io.ktor.routing.Routing.executeResult(Routing.kt:147)
      at io.ktor.routing.Routing.interceptor(Routing.kt:34)
      at io.ktor.routing.Routing$Feature$install$1.invokeSuspend(Routing.kt:99)
      at io.ktor.routing.Routing$Feature$install$1.invoke(Routing.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.features.ContentNegotiation$Feature$install$1.invokeSuspend(ContentNegotiation.kt:107)
      at io.ktor.features.ContentNegotiation$Feature$install$1.invoke(ContentNegotiation.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.features.StatusPages$interceptCall$2.invokeSuspend(StatusPages.kt:101)
      at io.ktor.features.StatusPages$interceptCall$2.invoke(StatusPages.kt)
      at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:91)
      at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:194)
      at io.ktor.features.StatusPages.interceptCall(StatusPages.kt:100)
      at io.ktor.features.StatusPages$Feature$install$2.invokeSuspend(StatusPages.kt:140)
      at io.ktor.features.StatusPages$Feature$install$2.invoke(StatusPages.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:188)
      at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:31)
      at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invokeSuspend(DefaultEnginePipeline.kt:121)
      at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invoke(DefaultEnginePipeline.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:188)
      at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:31)
      at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.invokeSuspend(NettyApplicationCallHandler.kt:40)
      at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.invoke(NettyApplicationCallHandler.kt)
      at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(Undispatched.kt:55)
      at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:111)
      at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:158)
      at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
      at kotlinx.coroutines.BuildersKt.launch(Unknown Source)
      at io.ktor.server.netty.NettyApplicationCallHandler.handleRequest(NettyApplicationCallHandler.kt:30)
      at io.ktor.server.netty.NettyApplicationCallHandler.channelRead(NettyApplicationCallHandler.kt:24)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
      at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:61)
      at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:370)
      at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
      at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
      at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
      at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
      at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
      at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
      at java.base/java.lang.Thread.run(Thread.java:832)
    
    Feb 13, 2021 5:28:37 PM com.impossibl.postgres.jdbc.ThreadedHousekeeper$HousekeeperReference cleanup
    WARNING: Cleaning up leaked result-set
    Allocation occurred @
      at org.jetbrains.exposed.sql.statements.jdbc.JdbcPreparedStatementImpl.executeQuery(JdbcPreparedStatementImpl.kt:21)
      at org.jetbrains.exposed.sql.Query.executeInternal(Query.kt:79)
      at org.jetbrains.exposed.sql.Query.executeInternal(Query.kt:15)
      at org.jetbrains.exposed.sql.statements.Statement.executeIn$exposed_core(Statement.kt:61)
      at org.jetbrains.exposed.sql.Transaction.exec(Transaction.kt:129)
      at org.jetbrains.exposed.sql.Query.count(Query.kt:251)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis$getAllCompanies$1.invoke(CompanyOwnerApis.kt:217)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis$getAllCompanies$1.invoke(CompanyOwnerApis.kt:13)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$inTopLevelTransaction$1.invoke(ThreadLocalTransactionManager.kt:170)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$inTopLevelTransaction$2.invoke(ThreadLocalTransactionManager.kt:191)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:199)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.inTopLevelTransaction(ThreadLocalTransactionManager.kt:190)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$transaction$1.invoke(ThreadLocalTransactionManager.kt:148)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:199)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:120)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:118)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction$default(ThreadLocalTransactionManager.kt:117)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis.getAllCompanies(CompanyOwnerApis.kt:213)
      at tech.tarunchawla.server.Gateway.getOwnerCompanies(Gateway.kt:101)
      at tech.tarunchawla.server.KtorApplicationConfigKt$module$5$7$5.invokeSuspend(KtorApplicationConfig.kt:103)
      at tech.tarunchawla.server.KtorApplicationConfigKt$module$5$7$5.invoke(KtorApplicationConfig.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:188)
      at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:31)
      at io.ktor.routing.Routing.executeResult(Routing.kt:147)
      at io.ktor.routing.Routing.interceptor(Routing.kt:34)
      at io.ktor.routing.Routing$Feature$install$1.invokeSuspend(Routing.kt:99)
      at io.ktor.routing.Routing$Feature$install$1.invoke(Routing.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.features.ContentNegotiation$Feature$install$1.invokeSuspend(ContentNegotiation.kt:107)
      at io.ktor.features.ContentNegotiation$Feature$install$1.invoke(ContentNegotiation.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.features.StatusPages$interceptCall$2.invokeSuspend(StatusPages.kt:101)
      at io.ktor.features.StatusPages$interceptCall$2.invoke(StatusPages.kt)
      at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:91)
      at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:194)
      at io.ktor.features.StatusPages.interceptCall(StatusPages.kt:100)
      at io.ktor.features.StatusPages$Feature$install$2.invokeSuspend(StatusPages.kt:140)
      at io.ktor.features.StatusPages$Feature$install$2.invoke(StatusPages.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:188)
      at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:31)
      at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invokeSuspend(DefaultEnginePipeline.kt:121)
      at io.ktor.server.engine.DefaultEnginePipelineKt$defaultEnginePipeline$2.invoke(DefaultEnginePipeline.kt)
      at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:323)
      at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:168)
      at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:188)
      at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:31)
      at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.invokeSuspend(NettyApplicationCallHandler.kt:40)
      at io.ktor.server.netty.NettyApplicationCallHandler$handleRequest$1.invoke(NettyApplicationCallHandler.kt)
      at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(Undispatched.kt:55)
      at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:111)
      at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:158)
      at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
      at kotlinx.coroutines.BuildersKt.launch(Unknown Source)
      at io.ktor.server.netty.NettyApplicationCallHandler.handleRequest(NettyApplicationCallHandler.kt:30)
      at io.ktor.server.netty.NettyApplicationCallHandler.channelRead(NettyApplicationCallHandler.kt:24)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
      at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:61)
      at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:370)
      at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
      at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
      at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
      at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
      at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
      at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
      at java.base/java.lang.Thread.run(Thread.java:832)
    
    Feb 13, 2021 5:28:37 PM com.impossibl.postgres.jdbc.ThreadedHousekeeper$HousekeeperReference cleanup
    WARNING: Cleaning up leaked result-set
    Allocation occurred @
      at org.jetbrains.exposed.sql.statements.jdbc.JdbcPreparedStatementImpl.executeQuery(JdbcPreparedStatementImpl.kt:21)
      at org.jetbrains.exposed.sql.Query.executeInternal(Query.kt:79)
      at org.jetbrains.exposed.sql.Query.executeInternal(Query.kt:15)
      at org.jetbrains.exposed.sql.statements.Statement.executeIn$exposed_core(Statement.kt:61)
      at org.jetbrains.exposed.sql.Transaction.exec(Transaction.kt:129)
      at org.jetbrains.exposed.sql.Transaction.exec(Transaction.kt:115)
      at org.jetbrains.exposed.sql.Query.iterator(Query.kt:218)
      at kotlin.collections.CollectionsKt___CollectionsKt.first(_Collections.kt:198)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis$getCompanyDetails$1.invoke(CompanyOwnerApis.kt:243)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis$getCompanyDetails$1.invoke(CompanyOwnerApis.kt:13)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$transaction$1.invoke(ThreadLocalTransactionManager.kt:128)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:199)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:120)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:118)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction$default(ThreadLocalTransactionManager.kt:117)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis.getCompanyDetails(CompanyOwnerApis.kt:236)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis$getAllCompanies$1.invoke(CompanyOwnerApis.kt:221)
      at tech.tarunchawla.repository.apis.CompanyOwnerApis$getAllCompanies$1.invoke(CompanyOwnerApis.kt:13)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$inTopLevelTransaction$1.invoke(ThreadLocalTransactionManager.kt:170)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$inTopLevelTransaction$2.invoke(ThreadLocalTransactionManager.kt:191)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:199)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.inTopLevelTransaction(ThreadLocalTransactionManager.kt:190)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$transaction$1.invoke(ThreadLocalTransactionManager.kt:148)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:199)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:120)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:118)
      at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction$default(ThreadLocalTransactionManager.kt:117)```
    
    
    
    
    Am using expose version: 0.29.1
    pgjdbc-ng:0.8.6
    opened by trnchawla 21
  • Name for primary key constraint

    Name for primary key constraint

    At the moment there seems to be no way to set a constraint name for primary key:

    object TestTable : IdTable<Long>("test") {
        override val id = long("id")
            .primaryKey() // <- cant set the name
            .autoIncrement("test_table_id_seq")
            .entityId()
    }
    

    Exposed seems to always generate it automatically using this pattern:

    pk_$tableName
    

    I would like to have the ability to use a different naming pattern as I'm following this naming convention.

    enhancement good-first-issue 
    opened by Edvinas01 19
  • In-memory Sqlite DB disappears between transactions

    In-memory Sqlite DB disappears between transactions

    I have an in-memory sqlite db. The following code yields an error. Here's the code:

    import org.jetbrains.exposed.dao.EntityID
    import org.jetbrains.exposed.dao.UUIDEntity
    import org.jetbrains.exposed.dao.UUIDEntityClass
    import org.jetbrains.exposed.dao.UUIDTable
    import org.jetbrains.exposed.sql.*
    import org.jetbrains.exposed.sql.transactions.TransactionManager
    import org.jetbrains.exposed.sql.transactions.transaction
    import photo.backup.kt.data.HashTable
    import java.sql.Connection
    import java.util.*
    
    object MyTable: UUIDTable() {
        val name = varchar("name", 50)
    }
    
    class Name(id: EntityID<UUID>): UUIDEntity(id) {
        companion object: UUIDEntityClass<Name>(MyTable)
    
        var name by MyTable.name
    }
    
    fun main() {
        val db = Database.connect("jdbc:sqlite:file:test?mode=memory&cache=shared", "org.sqlite.JDBC")
        TransactionManager.manager.defaultIsolationLevel = Connection.TRANSACTION_SERIALIZABLE
        transaction(db) {
            addLogger(StdOutSqlLogger)
            SchemaUtils.create(MyTable)
        }
        println(UUID.randomUUID())
        val id = transaction(db) {
            MyTable.insert {
                it[name] = "Foo"
            } get MyTable.id
        }
        println(id)
    }
    
    main()
    

    Here's the error:

    Exception in thread "main" org.jetbrains.exposed.exceptions.ExposedSQLException: org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (no such table: My)
    SQL: [INSERT INTO My (id, "name") VALUES (?, ?)]
    	at org.jetbrains.exposed.sql.statements.Statement.executeIn$exposed_core(Statement.kt:50)
    	at org.jetbrains.exposed.sql.Transaction.exec(Transaction.kt:122)
    	at org.jetbrains.exposed.sql.Transaction.exec(Transaction.kt:108)
    	at org.jetbrains.exposed.sql.statements.Statement.execute(Statement.kt:29)
    	at org.jetbrains.exposed.sql.QueriesKt.insert(Queries.kt:45)
    	at org.jetbrains.kotlin.idea.scratch.generated.ScratchFileRunnerGenerated$ScratchFileRunnerGenerated$main$id$1.invoke(tmp.kt:34)
    	at org.jetbrains.kotlin.idea.scratch.generated.ScratchFileRunnerGenerated$ScratchFileRunnerGenerated$main$id$1.invoke(tmp.kt:16)
    	at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$inTopLevelTransaction$1.invoke(ThreadLocalTransactionManager.kt:156)
    	at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$inTopLevelTransaction$2.invoke(ThreadLocalTransactionManager.kt:197)
    	at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:205)
    	at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.inTopLevelTransaction(ThreadLocalTransactionManager.kt:196)
    	at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt$transaction$1.invoke(ThreadLocalTransactionManager.kt:134)
    	at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.keepAndRestoreTransactionRefAfterRun(ThreadLocalTransactionManager.kt:205)
    	at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:106)
    	at org.jetbrains.exposed.sql.transactions.ThreadLocalTransactionManagerKt.transaction(ThreadLocalTransactionManager.kt:104)
    	at org.jetbrains.kotlin.idea.scratch.generated.ScratchFileRunnerGenerated$ScratchFileRunnerGenerated.main(tmp.kt:33)
    	at org.jetbrains.kotlin.idea.scratch.generated.ScratchFileRunnerGenerated$ScratchFileRunnerGenerated.generated_get_instance_res0(tmp.kt:40)
    	at org.jetbrains.kotlin.idea.scratch.generated.ScratchFileRunnerGenerated.main(tmp.kt:52)
    Caused by: org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (no such table: My)
    	at org.sqlite.core.DB.newSQLException(DB.java:909)
    	at org.sqlite.core.DB.newSQLException(DB.java:921)
    	at org.sqlite.core.DB.throwex(DB.java:886)
    	at org.sqlite.core.NativeDB.prepare_utf8(Native Method)
    	at org.sqlite.core.NativeDB.prepare(NativeDB.java:127)
    	at org.sqlite.core.DB.prepare(DB.java:227)
    	at org.sqlite.core.CorePreparedStatement.<init>(CorePreparedStatement.java:41)
    

    chaging Database.connect("jdbc:sqlite:file:test?mode=memory&cache=shared", "org.sqlite.JDBC") to Database.connect("jdbc:sqlite:/path/to/data.db", "org.sqlite.JDBC")

    then the DB is created and the insertion happens correctly

    sqlite 
    opened by kylegoetz 18
  • Support for LocalDate

    Support for LocalDate

    It would be nice if this would support a java.time.LocalDate object:

    object Person : Table("person") {
        val id = integer("id").autoIncrement().primaryKey()
        val name = varchar("firstName", 100)
        val dateOfBirth = date("dateOfBirth")
    }
    
    Person.insert {
        it[name] = "Dave Ford"
        it[dateOfBirth] = LocalDate.parse("1966-10-14") //does not compile
    }
    
    enhancement datetime 
    opened by StokeMasterJack 18
  • Support explicit transaction manager

    Support explicit transaction manager

    ExplicitTransactionManager (as opposed to ThreadLocalTransactionManager) will allow supporting features that require switching threads inside a transaction. Examples of that are coroutines and thread pools usage inside a transaction.

    I think that in order to be able to do that TransactionManager companion object references should be replaced in statements and queries. I can try to do a priliminary pull request to make the suggestion more clear if that sounds like an approach we would like to take. I guess it might change some interfaces/method signaures.

    enhancement 
    opened by oshai 17
  • support for native sql?

    support for native sql?

    Exposed looks great! Yet at some point I fear that some complex queries will not be representable by Kotlin magic. And, frankly,

    (Users innerJoin Cities).slice(Users.name, Cities.name).
                select {(Users.id.eq("andrey") or Users.name.eq("Sergey")) and
                        Users.id.eq("sergey") and Users.cityId.eq(Cities.id)}.forEach {
                println("${it[Users.name]} lives in ${it[Cities.name]}")
            }
    

    Is too high-level magic for my tired brain :-)

    I would prefer something like this for complex queries (you know one of those queries hand-tuned for perfection, which runs only 5 hours instead of 10 weeks):

    "select u.name, c.name from user u inner join city c where blah blah".map(Users.name, Cities.name).forEach { ... }
    

    Anyway, thanks for a fresh wind in the stale waters of JPA ;) It's good to have a framework where I can represent tables with objects, but without the 1st level cache/LazyInitializationException/other goodies from the JPA world. Yet, I want to be in charge of creating/migrating tables (of the DDL), and of queries more complex than "gimme all users in this city".

    documentation 
    opened by mvysny 17
  • Exposed slow

    Exposed slow

    I'm trying to connect to the H2 database on an embedded device.

    The connection using

    Database.connect("jdbc:h2:~/testdb;DB_CLOSE_DELAY=-1", driver = "org.h2.Driver", user = "root", password = "")
    

    takes about 7s to create/open a database, but the connection using another library, for example kotliquery

    val create = measureTimeMillis {
                sess = sessionOf("jdbc:h2:~/testdb;DB_CLOSE_DELAY=-1", "root", "")
                sess.execute(queryOf("CREATE TABLE IF NOT EXISTS RandomText(ID INT PRIMARY KEY auto_increment, text VARCHAR(15));"))
            }
    

    takes about 2s.

    Any reason for that overhead and is there any way to speed it up?

    We're running the program and the database on an embedded device called Colibri IMx6, and the speedup would greatly help us.

    opened by MGlolenstine 16
  • MySQL table names case sensitivity

    MySQL table names case sensitivity

    MySQL documentation https://dev.mysql.com/doc/refman/5.7/en/identifier-case-sensitivity.html says about system variable lower_case_table_names value 2:

    Table and database names are stored on disk using the lettercase specified in the CREATE TABLE or CREATE DATABASE statement, but MySQL converts them to lowercase on lookup. Name comparisons are not case sensitive. This works only on file systems that are not case sensitive! InnoDB table names are stored in lowercase, as for lower_case_table_names=1.

    And this is exactly what I see on my Mac when I run tests. First of all, org.jetbrains.exposed.sql.tests.shared.DDLTests#testCreateMissingTablesAndColumns01 creates table Busy and MySQL shows it with capital B (SQL query is SELECT * FROM information_schema.tables where table_schema = 'testdb1';). But immediately after that we create index CREATE UNIQUE INDEX Busy_busy_unique ON Busy (busy) and our table renamed to busy in lowercase. So far so good, but org.jetbrains.exposed.sql.tests.shared.DDLTests#addAutoPrimaryKey also has Busy-table logic and it checks if Busy table exists. When we load all table names in org.jetbrains.exposed.sql.vendors.VendorDialect#allTablesNames we load table name as busy, no chance to convert to Busy. org.jetbrains.exposed.sql.vendors.VendorDialect#getInProperCase checks that both TransactionManager.current().db.metadata.storesUpperCaseIdentifiers() and TransactionManager.current().db.metadata.storesLowerCaseIdentifiers() are false and org.jetbrains.exposed.sql.Table#nameInDatabaseCase do not converts table name to lowercase. After that org.jetbrains.exposed.sql.vendors.VendorDialect#tableExists can't find table Busy and org.jetbrains.exposed.sql.SchemaUtils#createStatements generates statements to create table Busy.

    CREATE TABLE IF NOT EXISTS Busy (busy BOOLEAN NOT NULL) works fine and does nothing, but index creation CREATE UNIQUE INDEX Busy_busy_unique ON Busy (busy) fails with weird Duplicate key name 'Busy_busy_unique'. And each isolated test works fine.

    I suggest that org.jetbrains.exposed.sql.vendors.VendorDialect#tableExists should ignore storesUpperCaseIdentifiers()/storesUpperCaseIdentifiers() and compare lowercases against lowercases. It's possible to support system property that forces to compare table names without converting it to lowercase. Probably, org.jetbrains.exposed.sql.vendors.VendorDialect#allTablesNames shouldn't do any conversion.

    Also I am not sure that we need to use org.jetbrains.exposed.sql.SchemaUtils#withDataBaseLock in org.jetbrains.exposed.sql.SchemaUtils#createMissingTablesAndColumns.

    opened by YakovSirotkin 16
  • Can't load implementation for DatabaseConnectionAutoRegistration

    Can't load implementation for DatabaseConnectionAutoRegistration

    java.lang.ExceptionInInitializerError: null
    	at one.xjcyan1de.creativeplus.CreativePlus.connectDatabase(CreativePlus.kt:70) ~[?:?]
    	at one.xjcyan1de.creativeplus.CreativePlus.enable(CreativePlus.kt:43) ~[?:?]
    	at com.github.xjcyan1de.cyanlibz.plugin.ExtendedBukkitPlugin.onEnable(ExtendedBukkitPlugin.kt:38) ~[?:?]
    	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.15.1.jar:git-Paper-27]
    	at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:338) ~[patched_1.15.1.jar:git-Paper-27]
    	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:420) ~[patched_1.15.1.jar:git-Paper-27]
    	at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugin(CraftServer.java:468) ~[patched_1.15.1.jar:git-Paper-27]
    	at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugins(CraftServer.java:382) ~[patched_1.15.1.jar:git-Paper-27]
    	at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:481) ~[patched_1.15.1.jar:git-Paper-27]
    	at net.minecraft.server.v1_15_R1.DedicatedServer.init(DedicatedServer.java:290) ~[patched_1.15.1.jar:git-Paper-27]
    	at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:884) ~[patched_1.15.1.jar:git-Paper-27]
    	at java.lang.Thread.run(Thread.java:834) [?:?]
    Caused by: java.lang.IllegalStateException: Can't load implementation for DatabaseConnectionAutoRegistration
    	at org.jetbrains.exposed.sql.Database.<clinit>(Database.kt:64) ~[?:?]
    	... 12 more
    

    CreativePlus.connectDatabase:

        private fun connectDatabase() = Database.connect(
            HikariDataSource(HikariConfig().apply {
                jdbcUrl = Config.sqlUrl
                driverClassName = Config.sqlDriver
                username = Config.sqlUsername
                password = Config.sqlPassword
                maximumPoolSize = 4
                addDataSourceProperty("cachePrepStmts", "true")
                addDataSourceProperty("prepStmtCacheSize", "250")
                addDataSourceProperty("prepStmtCacheSqlLimit", "2048")
                addDataSourceProperty("characterEncoding", "utf8")
                addDataSourceProperty("useUnicode", "true")
                addDataSourceProperty("useSSL", "false")
                addDataSourceProperty("useJDBCCompliantTimezoneShift", "true")
                addDataSourceProperty("useLegacyDatetimeCode", "false")
                addDataSourceProperty("serverTimezone", TimeZone.getDefault().id)
            })
        )
    
    bug 
    opened by ghost 14
  • Support time math

    Support time math

    There are a number of time math functions, that while supported in Kotlin and commonly in databases (I don't know exactly how prevalent they are, but I suspect very), aren't possible to express in Exposed without resorting to custom functions.

    For example <timestamp> + <duration> * <int>.

    Currently, arithmetic ops on time types require using the same type, which can get a bit non-sensical.

    I think the two primary ops that would be good to have are <timestamp> +|- <duration> and <duration> *|/ <scalar>

    opened by rnett 0
  • Allow

    Allow "For Update" to select which table it references

    For update selects the second table in joins, this is not what you want when building a lock. We ideally should be able to define the table it is targeting.

    Example join:

    Equine
        .leftJoin(EquineStatuses)
        .slice(Equine.columns.plus(EquineStatuses.columns))
        .select { Equine.id eq id }
        .orderBy(Equine.barnName to SortOrder.ASC, EquineStatuses.added to SortOrder.DESC)
        .let { if (forUpdate) it.forUpdate() else it }
    

    Will throw: org.postgresql.util.PSQLException: ERROR: FOR UPDATE cannot be applied to the nullable side of an outer join

    We need something like:

    forUpdate(tableA)

    opened by chrisjenx 1
  • Eager loading does not support chunking, which leads to ORA-01795

    Eager loading does not support chunking, which leads to ORA-01795

    Software details

    Database: Oracle 19.1 Oracle driver version: 19.8.0.0 Kotlin version: 1.7.10 Exposed version: 0.40.1

    Exception:

    WARN Exposed - Transaction attempt #0 failed: java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000

    Code:

    // Entity
    class Poll(id: EntityID<Long>) : LongEntity(id) {
        companion object : LongEntityClass<Poll>(OldPolls)
    
        var path by OldPolls.path
        var pollId by OldPolls.pollId
        val options by PollOption referrersOn OldPollOptions.poll
    }
    
    // Service
    fun getAllPolls(): List<PollDto> = transaction {
        Poll.all().with(Poll::options).toList()
    }
    

    Explanation:

    Eager loading is basically some aggregating request with all ids that are put into IN clause. In the case of the Oracle database, there is a limitation that restricts the maximum size of IN clause to 1000 entries.

    Possible solution:

    By adding some alternative "withChunked" method or overloading existing "with" with an extra Int parameter, so all the data can be pre-fetch in batches.

    opened by TheDeathCry 1
  • Simple Table with schema fails when using SchemaUtils.createMissingTablesAndColumns

    Simple Table with schema fails when using SchemaUtils.createMissingTablesAndColumns

    Whenever I try to use a schema it fails with a schema table, when I am going to initialize with SchemaUtils.createMissingTablesAndColumns

    object Tests: LongIdTable("auth.test")
    
    SchemaUtils.createSchema(Schema("auth"))
    
    SchemaUtils.createMissingTablesAndColumns(
        listOf(Tests),
        inBatch = true,
        withLogs = true
    )
    

    DEBUG Exposed - CREATE TABLE IF NOT EXISTS auth.test (id BIGSERIAL PRIMARY KEY) DEBUG Exposed - ALTER TABLE auth.test ADD id BIGSERIAL PRIMARY KEY WARN Exposed - Transaction attempt #0 failed: java.sql.BatchUpdateException: Batch entry 0 ALTER TABLE auth.test ADD id BIGSERIAL PRIMARY KEY was aborted: ERROR: column "id" of relation "test" already exists Call getNextException to see other errors in the batch.. Statement(s): ALTER TABLE auth.test ADD id BIGSERIAL PRIMARY KEY

    With that I am not able to use any database schema

    opened by BlackHornet 0
  • Bump org.jetbrains.kotlin.jvm from 1.7.21 to 1.8.0

    Bump org.jetbrains.kotlin.jvm from 1.7.21 to 1.8.0

    Bumps org.jetbrains.kotlin.jvm from 1.7.21 to 1.8.0.

    Release notes

    Sourced from org.jetbrains.kotlin.jvm's releases.

    Kotlin 1.8.0

    Changelog

    Analysis API

    • KT-50255 Analysis API: Implement standalone mode for the Analysis API

    Analysis API. FIR

    • KT-54292 Symbol Light classes: implement PsiVariable.computeConstantValue for light field
    • KT-54293 Analysis API: fix constructor symbol creation when its accessed via type alias

    Android

    • KT-53342 TCS: New AndroidSourceSet layout for multiplatform
    • KT-53013 Increase AGP compile version in KGP to 4.1.3
    • KT-54013 Report error when using deprecated Kotlin Android Extensions compiler plugin
    • KT-53709 MPP, Android SSL2: Conflicting warnings for androidTest/kotlin source set folder

    Backend. Native. Debug

    • KT-53561 Invalid LLVM module: "inlinable function call in a function with debug info must have a !dbg location"

    Compiler

    New Features

    • KT-52817 Add @​JvmSerializableLambda annotation to keep old behavior of non-invokedynamic lambdas
    • KT-54460 Implementation of non-local break and continue
    • KT-53916 Support Xcode 14 and new Objective-C frameworks in Kotlin/Native compiler
    • KT-32208 Generate method annotations into bytecode for suspend lambdas (on invokeSuspend)
    • KT-53438 Introduce a way to get SourceDebugExtension attribute value via JVMTI for profiler and coverage

    Performance Improvements

    • KT-53347 Get rid of excess allocations in parser
    • KT-53689 JVM: Optimize equality on class literals
    • KT-53119 Improve String Concatenation Lowering

    Fixes

    • KT-53465 Unnecessary checkcast to array of reified type is not optimized since Kotlin 1.6.20
    • KT-49658 NI: False negative TYPE_MISMATCH on nullable type with when
    • KT-48162 NON_VARARG_SPREAD isn't reported on *toTypedArray() call
    • KT-43493 NI: False negative: no compilation error "Operator '==' cannot be applied to 'Long' and 'Int'" is reported in builder inference lambdas
    • KT-54393 Change in behavior from 1.7.10 to 1.7.20 for java field override.
    • KT-55357 IllegalStateException when reading a class that delegates to a Java class with a definitely-not-null type with a flexible upper bound
    • KT-55068 Kotlin Gradle DSL: No mapping for symbol: VALUE_PARAMETER SCRIPT_IMPLICIT_RECEIVER on JVM IR backend
    • KT-51284 SAM conversion doesn't work if method has context receivers
    • KT-48532 Remove old JVM backend

    ... (truncated)

    Changelog

    Sourced from org.jetbrains.kotlin.jvm's changelog.

    1.8.0-RC2

    Compiler

    • KT-55357 IllegalStateException when reading a class that delegates to a Java class with a definitely-not-null type with a flexible upper bound
    • KT-55068 Kotlin Gradle DSL: No mapping for symbol: VALUE_PARAMETER SCRIPT_IMPLICIT_RECEIVER on JVM IR backend
    • KT-51284 SAM conversion doesn't work if method has context receivers
    • KT-55065 Kotlin Gradle DSL: Reflection cannot find class data for lambda, produced by JVM IR backend

    Tools. Compiler plugins. Serialization

    • KT-55340 Argument for kotlinx.serialization.UseSerializers does not implement KSerializer or does not provide serializer for concrete type

    Tools. Gradle

    • KT-55334 kaptGenerateStubs passes wrong android variant module names to compiler
    • KT-55255 Gradle: stdlib version alignment fails build on dynamic stdlib version.
    • KT-55363 [K1.8.0-Beta] Command line parsing treats plugin parameters as source files

    1.8.0-RC

    Compiler

    • KT-55108 IR interpreter: Error occurred while optimizing an expression: VARARG
    • KT-54884 "StackOverflowError: null" caused by Enum constant name in constructor of the same Enum constant
    • KT-55013 State checker use-after-free with XCode 14.1
    • KT-54275 K2: "IllegalArgumentException: KtParameter is not a subtype of class KtAnnotationEntry for factory REPEATED_ANNOTATION"

    JavaScript

    • KT-55097 KJS / IR + IC: Using an internal function from a friend module throws an unbound symbol exception
    • KT-54934 KJS / IR + IC: Suspend abstract function stubs are generated with unstable lowered ic signatures
    • KT-54895 KJS / IR + IC: broken cross module references for function default param wrappers

    Language Design

    Libraries

    • KT-54835 Document that Iterable.all(emptyCollection) returns TRUE.
    • KT-54168 Expand on natural order in comparator docs

    Native. Platform Libraries

    Tools. Compiler plugins. Serialization

    ... (truncated)

    Commits
    • da1a843 Add ChangeLog for 1.8.0-RC2
    • d325cf8 Call additional publishToMavenLocal in maven build scripts and enable info
    • 0403d70 Don't leave Gradle daemons after build scripts
    • 52b225d Fix task module-name is not propagated to compiler arguments
    • d40ebc3 Specify versions-maven-plugin version explicitly
    • 2e829ed Fix version parsing crash on Gradle rich version string
    • f603c0e Scripting, IR: fix capturing of implicit receiver
    • 06cbf8f Scripting, tests: enable custom script tests with IR
    • d61cef0 Fix deserialization exception for DNN types from Java
    • ea33e72 JVM IR: script is a valid container for local delegated properties
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
Releases(0.41.1)
Owner
JetBrains
JetBrains open source projects
JetBrains
Upsert DSL extension for Exposed, Kotlin SQL framework

Exposed Upsert Upsert DSL extension for Exposed, Kotlin SQL framework. Project bases on various solutions provided by community in the official "Expos

Reposilite Playground 23 Oct 6, 2022
ORMDroid is a simple ORM persistence framework for your Android applications.

ORMDroid is a simple ORM persistence framework for your Android applications, providing an easy to use, almost-zero-config way to handle model persist

Ross Bamford 87 Nov 10, 2022
LiteOrm is a fast, small, powerful ORM framework for Android. LiteOrm makes you do CRUD operarions on SQLite database with a sigle line of code efficiently.

#LiteOrm:Android高性能数据库框架 A fast, small, powerful ORM framework for Android. LiteOrm makes you do CRUD operarions on SQLite database with a sigle line

马天宇 1.5k Nov 19, 2022
JAKO: Just Another Kotlin Orm (PostgreSQL)

JAKO: Just Another Kotlin Orm (PostgreSQL) JAKO is a simple, minimal, no-dependency library to build and execute postgresql statements using a fluent

Alessio 6 May 27, 2022
Exposed spring integration and code generator for dsl interface

Infra-ORM 欢迎使用 Infra-ORM, 这是一个基于 Exposed 的 ORM 框架,可以和 Spring Boot 集成良好,如果你是 Kotlin 开发者,推荐你试试 Exposed, 配合 Infra-ORM 可以给你带来最佳的开发体验。 为什么造这个轮子? Exposed 提供

Red Sparrow 1 Jan 2, 2022
✨ Nifty Utilities and PostgreSQL Extensions for Exposed

✨ ExposedPowerUtils ✨ Utilities and Extensions for Exposed, because while Exposed is a pretty nice framework, it tries to support a lot of SQL dialect

null 9 Nov 8, 2022
A blazing fast, powerful, and very simple ORM android database library that writes database code for you.

README DBFlow is fast, efficient, and feature-rich Kotlin database library built on SQLite for Android. DBFlow utilizes annotation processing to gener

Andrew Grosner 4.9k Dec 30, 2022
greenDAO is a light & fast ORM solution for Android that maps objects to SQLite databases.

Check out ObjectBox Check out our new mobile database ObjectBox (GitHub repo). ObjectBox is a superfast object-oriented database with strong relation

Markus Junginger 12.6k Jan 3, 2023
Android ORM

Shillelagh Shillelagh is an sqlite library. It was built to make life easier. The entire library was built around simplicity when using sqlite in Andr

Andrew Reitz 49 Sep 11, 2020
Compile-time active record ORM for Android

Ollie Compile-time active record ORM for Android. Multiple mapping methods. SQLiteDatabase-like interface (QueryUtils.java). Lightweight query builder

Michael Pardo 423 Dec 30, 2022
a 3d database ORM experiment. (used in two commercial projects)

Android-TriOrm a 3d database ORM experiment for Android. (used in two commercial projects). based around small tables concept and JVM Serialization. H

Tomer Shalev 19 Nov 24, 2021
A blazing fast, powerful, and very simple ORM android database library that writes database code for you.

README DBFlow is fast, efficient, and feature-rich Kotlin database library built on SQLite for Android. DBFlow utilizes annotation processing to gener

Andrew Grosner 4.9k Dec 30, 2022
lightweight and minimalist ORM for Java/Android. works with SQLite & MySQL. (not actively maintained)

Description ORMAN is an minimalistic and lightweight ORM framework for Java which can handle your common database usage without writing SQL and strugg

Ahmet Alp Balkan 246 Nov 20, 2022
AndroidQuery is an Android ORM for SQLite and ContentProvider which focuses on easy of use and performances thanks to annotation processing and code generation

WARNING: now that Room is out, I no longer maintain that library. If you need a library to easy access to default android ContentProvider, I would may

Frédéric Julian 19 Dec 11, 2021
lightweight and minimalist ORM for Java/Android. works with SQLite & MySQL. (not actively maintained)

Description ORMAN is an minimalistic and lightweight ORM framework for Java which can handle your common database usage without writing SQL and strugg

Ahmet Alp Balkan 246 Nov 20, 2022
An ORM for Android with type-safety and painless smart migrations

Android Orma Orma is a ORM (Object-Relation Mapper) for Android SQLiteDatabase. Because it generates helper classes at compile time with annotation pr

The Maskarade project 440 Nov 25, 2022
Performance comparison of Android ORM Frameworks

Performance comparison of Android ORM Frameworks At the moment there are a lot of ORM-libraries for the Android OS. We reviewed the most popular ones

Alexey Zatsepin 328 Dec 21, 2022
requery - modern SQL based query & persistence for Java / Kotlin / Android

A light but powerful object mapping and SQL generator for Java/Kotlin/Android with RxJava and Java 8 support. Easily map to or create databases, perfo

requery 3.1k Dec 29, 2022
A Java/Kotlin library for Android platform, to manage bean's persistence in SQLite, SharedPreferences, JSON, XML, Properties, Yaml, CBOR.

Thanks to JetBrains for support Kripton Persistence Library project! Kripton Persistence Library Kripton is a java library, for Android platform, that

xcesco 117 Nov 11, 2022