tsql icon indicating copy to clipboard operation
tsql copied to clipboard

Table declarations with no columns should not be usable in queries

Open AnyhowStep opened this issue 6 years ago • 0 comments

For example,


const myTable = sql.table("myTable");

pool.acquire(async (connection) => {
    //Place all database calls inside here
    const row = await sql.from(myTable)
        .select(columns => [columns])
        .fetchAll(connection);
    console.log(row);
});

Playground

Expected: Compile error

Actual: Compiles, run-time error


This isn't a super-critical bug, in my opinion. But it would be nice to fix this.

Most people should not run into this problem.

AnyhowStep avatar Apr 05 '20 03:04 AnyhowStep