Links between databases are not implemented for postgresql?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
15 views
There is a table artist and user_artist
artist: - id (PK) - name user_artist: - id (PK) - userId(FK) - artistId(FK) - added

The following query returns an error
links between databases are not implemented: user_artist.added

return db.query(` SELECT artist.name AS "artistName", artist.id AS "artistId", user_artist.added FROM user_artist INNER JOIN artist ON artist.id = user_artist."artistId" WHERE user_artist."userId" = $(userId) AND user_artist.added::timestamp < to_timestamp($(index) / 1000) ORDER BY user_artist.added $(order) LIMIT $(limit);`, obj);

If you remove the ORDER BY user_artist.added $(order) then the error disappears.
Here the exact structure of the table user_artist
create table user_artist ( "id" serial primary key, "userId" serial REFERENCES user (id) on delete cascade, "artistId" serial REFERENCES artist (id) on delete cascade, the "added" timestamp, unique ("userId", "artistId") );


What's wrong?
by | 15 views

1 Answer

0 like 0 dislike
Links between different databases do not have to be implemented.
Therefore the parser believes that you are in a single request applying to different bases. Show the query you are sending to the database, but not how the query is built.
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
0 like 0 dislike
3 answers
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
110,608 questions
257,187 answers
0 comments
40,796 users