You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bumped into an interesting case where I have a table with a languages column thats is typed to a custom type named LANGUAGE[]. If a column is custom typed array, objection returns it as psql native array instead of javascript. I'll put steps to repro below.
Not really end of the world since I can just use TEXT[] for my case. I bumped into this problem using version 2.2.14. Tried also upgrading to the latest version of 3.1.5. Used also the jsonAttributes method but it didn't work.
Steps for repro:
CREATE TYPE language AS ENUM ('fi', 'en');
CREATE TABLE lamp(
id SERIAL PRIMARY KEY,
languages language[] NOT NULL -- If this his TEXT[] there are no issues.
);
INSERT INTO lamp(id, languages) VALUES (1, ARRAY['en', 'fi']::language[])
importLampfrom"../models/Lamp";exportconstgetLamp=async()=>{constlamp=awaitLamp.query().findById(1);// lamp.languages with language[] type returns '{en, fi}' // but with TEXT[] it returns ["en", "fi"] correctly}
As I said not huge problem and can be worked around pretty easily but more of an FYI if someone else happens to bump into the same problem.
The text was updated successfully, but these errors were encountered:
Bumped into an interesting case where I have a table with a
languages
column thats is typed to a custom type namedLANGUAGE[]
. If a column is custom typed array, objection returns it as psql native array instead of javascript. I'll put steps to repro below.Not really end of the world since I can just use
TEXT[]
for my case. I bumped into this problem using version2.2.14
. Tried also upgrading to the latest version of3.1.5
. Used also thejsonAttributes
method but it didn't work.Steps for repro:
Lamp.ts
model:LampController.ts
As I said not huge problem and can be worked around pretty easily but more of an FYI if someone else happens to bump into the same problem.
The text was updated successfully, but these errors were encountered: