Further information. What did you do, what did you expect?
SQLBoiler will convert the above statement into:
SELECT TOP (1) COUNT([dbo].[permission].*)
FROM [dbo].[permission]
INNER JOIN [dbo].[role_has_permission] on [dbo].[permission].[id] = [dbo].[role_has_permission].[permission_id]
WHERE (active = 1) AND ([dbo].[role_has_permission].[role_id]=15)
MSSQL error: Incorrect syntax near '*'.
MSSQL uses COUNT(*) instead of providing a wildcard with the prefixed schema and table as SQLBoiler does.
Possible fix:
Remove selected coloumns by adding queries.SetSelect(q.Query, nil) to Exists() finisher template like you did for Count() finisher function.
File: 03_finishers.go.tpl
// Exists checks if the row exists in the table.
func (q {{$alias.DownSingular}}Query) Exists({{if .NoContext}}exec boil.Executor{{else}}ctx context.Context, exec boil.ContextExecutor{{end}}) (bool, error) {
var count int64
queries.SetCount(q.Query)
queries.SetLimit(q.Query, 1)
queries.SetSelect(q.Query, nil)
{{if .NoContext -}}
err := q.Query.QueryRow(exec).Scan(&count)
{{else -}}`
What version of SQLBoiler are you using?
3.0.0
If this happened at runtime what code produced the issue?
Further information. What did you do, what did you expect?
SQLBoiler will convert the above statement into:
MSSQL uses COUNT(*) instead of providing a wildcard with the prefixed schema and table as SQLBoiler does.
Possible fix:
Remove selected coloumns by adding queries.SetSelect(q.Query, nil) to Exists() finisher template like you did for Count() finisher function.
File: 03_finishers.go.tpl