arthurhsu / lovefield-ts

Lovefield TypeScript port: successor of google/lovefield
Apache License 2.0
47 stars 3 forks source link

toSql() omits LIMIT and SKIP if a placeholder is used #25

Open arthurhsu opened 1 year ago

arthurhsu commented 1 year ago

const builder = db.select().from(tableA).limit(lf.bind(0)); console.log(lf.query.toSql(builder));

Actual "SELECT * FROM tableA;"

Expected "SELECT * FROM tableA LIMIT ?;"

Related code is at [1], and should be using lf.query.valueToSql_() at [2] (and check for skipBinder and limitBinder), but it is not.

I am seeing similar problems with printing the logical tree of a query, where |undefined| is shown instead of "?"

lf.tree.toString(logicalPlan.getRoot()) skip(undefined) -project() --table_access(tableA)