Skip to content

there is no writeUUIDArray method? #527

Closed

Description

@shawel

I have a column Array(UUID) but i am not sure how to write it for rowBinary inserts - thanks

Activity

  1. enqueue commented on Dec 13, 2020

    @enqueue
    Contributor

    Sorry, I do not know about how this works in the RowBinary API, have you tried sending the String representation instead?

    With JDBC API, you can simply do it like this:

    PreparedStatement statement = connection.prepareStatement(
        "INSERT INTO test.uuid_array (foo) VALUES (?)");
    statement.setArray(1, connection.createArrayOf("UUID", myUUIDArray));
    statement.executeUpdate();
    

    or shorter

    statement.setObject(1, myUUIDArray});
    
  2. shawel commented on Dec 13, 2020

    @shawel
    Author

    @enqueue thanks.
    Since I am using RowBinary API writeUUIDArray is missing but there is writeUUID so a work around is to do something like

    in scala
    values = is UUID arrays

    values = is UUID arrays 
    stream.writeUnsignedLeb128(values.length)
    values.foreach({
                uuid =>
                  stream.writeUUID(uuid)
              })
    
  3. added this to the 0.2.5 release milestone on Dec 28, 2020
  4. self-assigned this
    on Mar 5, 2021
  5. linked a pull request that will close this issueSupport more data types #589on Mar 5, 2021
  6. added
    data-types
    jdbc
    legacy
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

data-typesenhancementjdbclegacy

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions