For
forRaw
Name
Type
Required
Default
Description
query
.select( [ "id", "name" ] )
.from( "users" )
.forRaw( "JSON AUTO" );SELECT [id], [name]
FROM [users]
FOR JSON AUTOWas this helpful?
This section only applies to SQL Server Grammars.
In SQL Server, FOR clauses are how you can return JSON or XML directly from your query.
In qb, only raw expressions are accepted via the forRaw method.
expression
string
true
The raw sql for the FOR clause.
query
.select( [ "id", "name" ] )
.from( "users" )
.forRaw( "JSON AUTO" );SELECT [id], [name]
FROM [users]
FOR JSON AUTOWas this helpful?
Was this helpful?