Open Akatuoro opened 1 day ago
When giving a string as argument or tagged templates, SELECT.one
SELECT.one
const result = await SELECT.one('max(TravelID) as maxID') .from(Travel) const result = await SELECT.one `max(TravelID) as maxID` .from(Travel) // const result: PluralInstanceType<typeof Travel>
When using the entity as first argument (e.g. SELECT.one(Travel, t => t.TravelUUID) .where({ TravelID })), it correctly returns the Travel type.
SELECT.one(Travel, t => t.TravelUUID) .where({ TravelID })
Travel
const result = await SELECT.one `max(TravelID) as maxID` .from(Travel) // const result: Travel
https://cap.cloud.sap/docs/node.js/cds-ql#one
No response
Is there an existing issue for this?
Current Behavior
When giving a string as argument or tagged templates,
SELECT.one
When using the entity as first argument (e.g.
SELECT.one(Travel, t => t.TravelUUID) .where({ TravelID })
), it correctly returns theTravel
type.Expected Behavior
References
https://cap.cloud.sap/docs/node.js/cds-ql#one
Versions
Anything else? Logs?
No response