Hello! I have a table in my Postgres database like so:
CREATE TABLE public.library_database_records (
id bigint NOT NULL,
libguides_id bigint NOT NULL,
name character varying NOT NULL,
description character varying,
alt_names character varying[],
alt_names_concat character varying,
url character varying,
friendly_url character varying,
subjects character varying[],
subjects_concat character varying,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
searchable tsvector GENERATED ALWAYS AS ((((setweight(to_tsvector('public.unaccented_dict'::regconfig, (COALESCE(name, ''::character varying))::text), 'A'::"char") || setweight(to_tsvector('public.unaccented_dict'::regconfig, (COALESCE(alt_names_concat, ''::character varying))::text), 'B'::"char")) || setweight(to_tsvector('public.unaccented_dict'::regconfig, (COALESCE(description, ''::character varying))::text), 'C'::"char")) || setweight(to_tsvector('public.unaccented_dict'::regconfig, (COALESCE(subjects_concat, ''::character varying))::text), 'D'::"char"))) STORED
);
If I try to create a relation with an auto-generated schema:
class LibraryDatabaseRelation < ROM::Relation[:sql]
schema :library_database_records, infer: true
end
I get the following:
ROM::Schema::Inferrer::MissingAttributesError:
Following attributes in :library_database_records schema cannot be inferred and have to be defined explicitly: :searchable
I noticed that ROM defines certain PostgreSQL types for us, but tsvector is not one of those types. Should I file an issue and/or PR to define it in rom-sql? Or would it make more sense to define it in my application?
Thanks for your help!