• dmnk_89

    dmnk_89

    2 years ago
    SomeTable.batchInsert(
    				data = listOf(1,2,3,4),
    				body = {
    					this[SomeTable.someColumn] = it
    				})
    dmnk_89
    1 replies
    Copy to Clipboard
  • t

    Timur Atakishiev

    2 years ago
    I was able to use batch insert for exposed, but when I am adding
    transaction {
                addLogger(StdOutSqlLogger)
                SomeTable.batchInsert(data = listOf(1,2,3,4)) {
                    this[SomeTable.someColumn] = it
                }
    SQL logger shows multiple sql inserts(number of insrets = list.size) Should not it be one insert with multiple values? Or is it StdOutLogger problems?
    t
    s
    6 replies
    Copy to Clipboard
  • tapac

    tapac

    2 years ago
    Exposed 0.20.1 released. Check change log for more information of new features and bug fixes.https://github.com/JetBrains/Exposed/blob/master/ChangeLog.md#0201
    tapac
    1 replies
    Copy to Clipboard
  • Brian Carbone

    Brian Carbone

    2 years ago
    kotlin
    SELECT * FROM (
      SELECT DISTINCT ON (address_id) *
      FROM purchases 
      WHERE product_id = 1
      ORDER BY address_id, purchased_at DESC
    ) t
    ORDER BY purchased_at DESC
    what is the equivalent of this in exposed?
    Brian Carbone
    t
    +1
    3 replies
    Copy to Clipboard
  • a

    APXEOLOG

    2 years ago
    Hello guys! I'm migrating from 0.17 to 0.20. I was using jsonb data type from here:
    <https://gist.github.com/quangIO/a623b5caa53c703e252d858f7a806919>
    and i found out that ColumnType seems to be changed
    a
    1 replies
    Copy to Clipboard
  • Vinicius Araujo

    Vinicius Araujo

    2 years ago
    Hey there, is there a way to achieve this composite where clause with exposed?
    WHERE (updated_at, id) <= ('2020-01-04 15:51:38.862000', '79a4f222-69ea-439c-90ba-348d025166ef')
    Vinicius Araujo
    t
    6 replies
    Copy to Clipboard
  • t

    Timur Atakishiev

    2 years ago
    Hi all
    object Users : Table("users") {
        override val primaryKey = PrimaryKey(columns = *arrayOf(Column<Long>(Users, "id", LongColumnType())))
        val id = long("id").autoIncrement()
        val phoneNumber = varchar("phone_number", 20).uniqueIndex()
        val firstName = varchar("first_name", 25).nullable()
        val lastName = varchar("last_name", 30).nullable()
        val password = varchar("password", 150)
    }
    can someone help please, when I overriding primary key as
    override val primaryKey = PrimaryKey(columns = *arrayOf(id))
    IDE says me that I need to initialize the ID field, maybe I am doing something wrong? Or is it other way to declare a Primary key?
    t
    s
    2 replies
    Copy to Clipboard
  • p

    paulex

    2 years ago
    override fun modify(item: User): CompletionStage<User> {
        return supplyAsync {
            transaction {
                Users.update({ Users.id eq item.id }) {
                    it[name] = item.name
                    it[gender] = item.gender
                    it[first_name] = item.firstName;
                }
            }
        }.thenApply { return@thenApply item }
    }
    Is there a way to simplify an update transaction on object properties, i feel it is repetitive to keep on writing : it[name] = item.name it[gender] = item.gender ?
    p
    a
    +1
    3 replies
    Copy to Clipboard
  • t

    Timur Atakishiev

    2 years ago
    hey guys, can not find how to implement batch update in exposed, please help! I am using DSL
    t
    tapac
    +1
    10 replies
    Copy to Clipboard
  • c

    Carter

    2 years ago
    Hi. Issue 748 is blocking me from upgrading to the 0.20.x series. I know the code change has been merged to master. Is there a regular release schedule planned? No rush, just trying to figure out planning on my end as I’d like to be able to make the version bump to unblock some other code changes I’d like to make.
    c
    tapac
    7 replies
    Copy to Clipboard