For
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.
forRaw
Name
Type
Required
Default
Description
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?