in the getting started with MssqlDialect, the example is:
export async function createPerson(person: NewPerson) {
const compiledQuery = db.insertInto('person').values(person).compile()
compiledQuery.sql += '; select scope_identity() as id' // Error is on this line
const {
rows: [{ id }],
} = await db.executeQuery<Pick<Person, 'id'>>(compiledQuery)
return await findPersonById(id)
}
getting the error: Cannot assign to 'sql' because it is a read-only property. this is due the the fact that the sql property in src/query-compiler/compiled-query.ts as readonly sql: string
in the getting started with MssqlDialect, the example is:
getting the error:
Cannot assign to 'sql' because it is a read-only property
. this is due the the fact that the sql property insrc/query-compiler/compiled-query.ts
asreadonly sql: string