hediet/ts-typed-sql

Cannot select expression

Closed this issue · 2 comments

sql.select(sql.val(123))

The 'this' context of type 'typeof import(".../typed-sql")' is not assignable to method's 'this' of type 'SelectQuery<{}, {}, NoColumnsSelected>'.
  Type 'typeof import(".../typed-sql")' is missing the following properties from type 'SelectQuery<{}, {}, NoColumnsSelected>': _orderBys, _havingCondition, _groupBys, getState, and 23 more.ts(2684)

When importing select directly, the error is

The 'this' context of type 'void' is not assignable to method's 'this' of type 'SelectQuery<{}, {}, NoColumnsSelected>'.ts(2684)

Ok turns out the problem is just the location and text of the error message :/

sql.select(sql.val(123).as("tmp"))

works