Calling JS function without parentheses

Viewed 77

Today I came across JS syntax I see for the first time. In Microsoft MSSQL client for nodeJS there is this example:

const sql = require('mssql')
 
async () => {
    try {
        // make sure that any items are correctly URL encoded in the connection string
        await sql.connect('mssql://username:password@localhost/database')
        const result = await sql.query`select * from mytable where id = ${value}`
        console.dir(result)
    } catch (err) {
        // ... error checks
    }
}

What is the meaning of this line:

await sql.query`select * from mytable where id = ${value}`

It looks like query is a method on sql object but how it can be called like this? Is this appended interpolated string passed as argument? What is the name of this JS feature?

1 Answers
Related