Skip to content

Add DELETE and UPDATE to trino-base-jdbc #6993

@lhofhansl

Description

@lhofhansl

Looking at the code involves something like the following:

  • use getPageSourceProvider instead of getRecordSetProvider in JdbcConnector and return an UpdatablePageSource (probably a class that extends RecordPageSource and wraps the existing ResultSet)
  • Implement the UpdatablePageSource methods (updateRows, deleteRows, etc)
  • Figure out the RowId column handle - for JDBC just the PK columns
  • Add getUpdateRowIdColumnHandle and getDeleteRowIdColumnHandle to JdbcMetadata
  • Add buildDeleteSql and buildUpdateSql to JdbcClient and use those from the UpdatablePageSource to perform the writes.
  • (And probably a bunch of more stuff...)

Once it's added to trino-base-jdbc it can be add the the Postgres, MySQL, Phoenix, etc, connectors.

Note sure I'll find time to do this, filing in case someones else is interested. :)

Relates to #5275

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions