Row normalizers project relational rows into Liquid compounds.
Use a row normalizer when:
create table account_profiles (
account_id text primary key,
display_name text not null,
tier text not null
);
select liquid.create_row_normalizer(
'account_profiles'::regclass,
'account_profile_normalizer',
'AccountProfile',
'{
"account_id": "id",
"display_name": "display_name",
"tier": "tier"
}'::jsonb,
true
);
select id, display_name, tier
from liquid.query($$
AccountProfile@(id=id, display_name=display_name, tier=tier)?
$$) as t(id text, display_name text, tier text);
select liquid.rebuild_row_normalizer(
'account_profiles'::regclass,
'account_profile_normalizer'
);
select liquid.drop_row_normalizer(
'account_profiles'::regclass,
'account_profile_normalizer',
true
);