postgresqljooqpg-trgm

How to use pg_trgm functions in JOOQ


Is it possible to use pg_trgm functions as similarity in JOOQ?


Solution

  • Whenever some vendor-specific feature is missing from jOOQ, use the plain SQL API:

    Here's how to create a similarity function:

    public static Field<Double> similarity(Field<String> a, Field<String> b) {
        return DSL.field("similarity({0}, {1})", Double.class, a, b);
    }