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
entityTravels:managed, cuid {
displayId:Integer @readonlydefault0@assert.unique;
beginDate:Date;
endDate:Date;
bookingFee:Decimal(16, 3);
totalPrice:Decimal(16, 3)@readonly;
currencyCode:Currency;
description:String(40);
travelStatus:Association to TravelStatuses@readonly;
agency:Association to TravelAgencies@assert.integrity;
customer:Association to Passengers@assert.integrity;
bookings:Composition of many Bookingsonbookings.travel=$self;
bookingSupplements:Association to many BookingSupplementsonbookingSupplements.travel=$self;
};
I do not get a type error if I use an invalid column name when supplying columns or using where.
I would expect to get a type error if I use an invalid column name to make the development easier and faster.
Is this possible?
Through the .from(Travels) the valid column names could be inferred or not? I am no TypeScript expert and just enjoy using it. As I think this would be very beneficial I just want to ask if this is possible or understand why this is not possible.
The text was updated successfully, but these errors were encountered:
You also can use the projection syntax which is provided out of the box and provides at least the typings for the columns method,
awaitSELECT.from(Travels).columns((t)=>[t.displayId,t.invalidColumn])// compiler will complain that invalidColumn is not a property of t).where({invalidColumn: 'ABC'});
I will attempt to add this in the next release of cds-types. As CQL is quite powerful and allows for several different syntaxes to express where and having, we'll have to circle in on the a full solution over time.
I have an entity definitions like follows:
Now I am writing a SELECT command:
I do not get a type error if I use an invalid column name when supplying columns or using where.
I would expect to get a type error if I use an invalid column name to make the development easier and faster.
Is this possible?
Through the
.from(Travels)
the valid column names could be inferred or not? I am no TypeScript expert and just enjoy using it. As I think this would be very beneficial I just want to ask if this is possible or understand why this is not possible.The text was updated successfully, but these errors were encountered: