Interface JdbcDialect

All Known Implementing Classes:
ClickHouseDialect, DefaultDialect, DuckDBDialect

public interface JdbcDialect
  • Method Details

    • supports

      default boolean supports(io.github.jdbcx.Compression compress)
      Checks if the compression algorithm is supported or not.
      Parameters:
      compress - non-null compression algorihtm
      Returns:
      true if it's supported; false otherwise
    • supports

      default boolean supports(io.github.jdbcx.Format format)
      Checks if the data format is supported or not.
      Parameters:
      format - non-null data format
      Returns:
      true if it's supported; false otherwise
    • supportMultipleResultSetsPerStatement

      default boolean supportMultipleResultSetsPerStatement()
      Whether a Statement supports multiple ResultSet in open status.
      Returns:
      true multiple ResultSets are supported; false otherwise
    • getPreferredCompression

      default io.github.jdbcx.Compression getPreferredCompression()
      Gets preferred compression algorithm.
      Returns:
      non-null compression algorithm
    • getPreferredFormat

      default io.github.jdbcx.Format getPreferredFormat()
      Gets preferred data format.
      Returns:
      non-null data format
    • getEncodings

      default String getEncodings(io.github.jdbcx.Compression serverCompress)
    • getMimeTypes

      default String getMimeTypes(io.github.jdbcx.Format serverFormat)
    • getVariableTag

      default io.github.jdbcx.VariableTag getVariableTag()
    • getValueFactory

      default io.github.jdbcx.ValueFactory getValueFactory(io.github.jdbcx.Format format)
    • getMapper

      ResultMapper getMapper()
    • getRemoteTable

      default String getRemoteTable(Connection conn, String url) throws SQLException
      Gets table representing the given URL. This is typically used in a query like shown below.
       select * from {{ table.db.mysql1: select 1 }}
       
      The inner query will be translated to 'http://bridge-server:8080/<uuid>.csv' by default. This various on different databases, for examples:
      • On DuckDB, it's read_csv('http://bridge-server:8080/<uuid>.csv', auto_detect=true)
      • On ClickHouse, url table function will be used, so it becomes url('http://bridge-server:8080/<uuid>.csv', 'CSVWithNames')
      Parameters:
      conn - connection
      url - url
      Returns:
      table representing the given URL
      Throws:
      SQLException