FR (Retool DB) - Add Array Column Setting Under Custom Preset

Currently, the only way to add an array type is to use JSON/JSONB which works but since types are inferred (and potentially converted) behind the scenes we can end up with type problems (unless we use an extra attribute for type, taking more space). According to the Postgresql docs arrays of built-in types are allowed:

PostgreSQL allows columns of a table to be defined as variable-length multidimensional arrays.

something like above would let us define static and variable length single/multi-dimensional arrays using the types already supported by Retool. The difference in the 'CREATE TABLE' statement is minimal and could be achieved with simple conditionals:

// no array:
CREATE TABLE sal_emp (
    name            text,
    pay_by_quarter  integer,
    schedule        text
);
// array:
CREATE TABLE sal_emp (
    name            text,
    pay_by_quarter  integer[],
    schedule        text[][]
);

Thanks for the request! We are tracking feedback on this. It doesn't look like it is being prioritized in the near term, but I'll update this topic if that changes.

1 Like

Hey folks, sharing a brief update here. Unfortunately, we haven’t been able to prioritize adding the Array type to Retool DB yet. For the time being, we recommend exploring the following workarounds:

  • Using JSON type, as noted above in this feature request
  • Using our Query Library to perform SQL and create the field manually