only-cliches/Nano-SQL

Conform Rows failing

benoror opened this issue · 2 comments

Which version are you using?

When running the conform rows query without a where statement (for applying it to all the rows in a table), nSQL code seems to be expecting it to be provided always, thus failing

Describe the bug

Example code:

function alterTable(tableSchema) {
  return nSQL(tableSchema.name)
    .query("alter table", tableSchema)
    .exec()
    .then(() =>
      nSQL(tableSchema.name)
        .query("conform rows") // <--- here
        .exec()
    );
}

Exception backtrace:

Screen Shot 2019-08-29 at 22 21 39

Example

https://codepen.io/benoror/pen/VwZWJRG

Expected behavior

Allow a conform rows query without an explicit where statement

Update: It actually seems to fail even with a where statement, and fails in the _getRecords function, prior to _conform as shown in the screenshot

This issue should be resolved in nanoSQL 2.3.7, just released on NPM.