Ent API: selectBy() Unique Key Prefix
Last updated
await Promise.all([
EntInverse.selectBy(vc, { type: "user2topics", id1: "123" }),
EntInverse.selectBy(vc, { type: "user2topics", id1: "456" }),
]);SELECT * FROM inverses
WHERE type='user2topics' AND id1 IN('123', '456')await Promise.all([
EntInverse.selectBy(vc, { type: "user2topics", id1: "123" }),
EntInverse.selectBy(vc, { type: "user2topics", id1: "456" }),
EntInverse.selectBy(vc, { type: "topic2comments", id1: "789" }),
]); -- DON'T DO IT!
SELECT * FROM inverses WHERE
(type='user2topics' AND id1 IN('123', '456')) OR
(type='topic2comments' AND id1 IN('789'))-- Good plan!
SELECT * FROM inverses WHERE (type, id1) IN(VALUES(
('user2topics', '123'),
('user2topics', '456'),
('topic2comments', '789')
))