Diagnostics
Every code, explained.
When a query or directive is wrong, sgl says where, with a stable code. Codes are never reused, so editors, CI scripts and code scanning can rely on them. Run sgl explain with a code for the same text in your terminal.
error25 stop generationwarning20 report a likely mistakehint5 suggest an improvement
Directives
- Q007errorDirective syntax errorA directive could not be read: an unexpected character, token or end of input.
- Q008errorMissing name or commandThe short sgl(...) header is missing its name or command keyword argument.
- Q026errorUnknown directiveA directive name is not one Seagull knows.
- Q027errorUnknown keyword argumentA directive was given a keyword argument it does not accept.
- Q028errorInvalid keyword argument valueA keyword argument's value is not allowed.
- Q029errorDuplicate keyword argumentThe same keyword argument appears twice in one directive.
- Q031errorMissing required argumentA directive is missing a required argument.
- Q032errorUnclosed directiveA multi-line directive is never closed with ')'.
- Q033errorParameter binding syntaxA parameter line is not in the form $1 as sgl.param(...).
- Q034errorInvalid listA bracketed list does not end with ']'.
- Q035errorUnterminated stringA quoted string in a directive is never closed.
- Q038errorConflicting keyword argumentsTwo keyword arguments that cannot be combined are both set.in 1 example
- Q039errorToo many directive linesA query header has more directive lines than the parser will read.
- Q044warningDirective in the wrong fileAn sgl.migration is in a query file, or an sgl.query is in a migration.
- Q050hintAlias prefix usednewA directive uses the seagull. alias rather than the canonical sgl. prefix.in 1 example
- Q051warningPrefix from another toolnewA comment uses a directive prefix that is not enabled, such as piko.in 1 example
Names and types
- Q001warningUnknown columnA column reference does not resolve in any table or alias in scope.
- Q002warningAmbiguous columnA column name matches more than one table in the current scope.
- Q003warningUnknown tableA table, CTE or table-valued function is not in the catalogue.
- Q004warningExpression type errorThe type of an expression could not be inferred.
- Q005warningUnknown functionA function call has no matching overload for its arguments.in 1 example
- Q020errorUNION branches differA UNION, INTERSECT or EXCEPT branch has a different number of columns from the first SELECT.
- Q030warningInternal checkA defensive check in type resolution fired. It should not normally happen.
- Q045warningFunction access undeclaredA dialect resolved a function without saying whether it reads or writes data.in 1 example
Commands and results
- Q006errorDuplicate query nameTwo queries declare the same name.
- Q009warningCommand and output disagreeThe declared command does not match what the query returns.in 1 example
- Q012hintMore than one statementA query block contains more than one SQL statement; only the last is analysed.
- Q013warningWrites a generated columnA parameter assigns to a generated column, which cannot be written.in 1 example
- Q040hintUse asyncexecAn exec query runs a mutation the database applies asynchronously.in 1 example
- Q041errorasyncexec on a synchronous dialectasyncexec is used on a dialect whose mutations are synchronous.in 1 example
- Q042warningUnused parameterA parameter line names a placeholder that the query never uses.
- Q046warningON CONFLICT DO NOTHING with RETURNINGA one query pairs ON CONFLICT DO NOTHING with RETURNING.in 1 example
- Q047erroroptional needs oneoptional: true is set on a query where it means nothing.in 1 example
- Q052errorRETURNING not supportednewA query uses RETURNING on a dialect whose database does not support it, such as MySQL.
Dynamic queries and slices
- Q011warningSortable column not in outputAn sgl.sortable list names a column that the query does not select.in 1 example
- Q014warninggroup_by column not in outputThe group_by column is not in the query's output.in 1 example
- Q015warninggroup_by without an embedgroup_by is set but no sgl.embed groups the joined table's columns.in 1 example
- Q016warninggroup_by needs manygroup_by is used with a command other than many.in 1 example
- Q017errorSlice with batch or copyfromA kind: slice parameter is used with the batch or copyfrom command.in 2 examples
- Q018errorSlice in a runtime queryA kind: slice parameter is used in a dynamic: runtime query.in 1 example
- Q022hintRuntime filters are ANDedA dynamic: runtime query already has a WHERE, so runtime filters are added with AND.in 1 example
- Q023hintCount wraps the queryThe generated count query wraps the SELECT because it has GROUP BY, DISTINCT or a window function.in 1 example
- Q024warningNo Count for this queryA dynamic: runtime query could not be rewritten as a COUNT, so its builder has no Count(ctx).in 1 example
- Q025errorRuntime query ends with ;A dynamic: runtime query ends with a semicolon.
Migrations and overrides
- Q010errorSQL parse errorSQL could not be parsed, a query is empty, or a migration's DDL could not be applied.
- Q036errorOverride names a missing columnAn sgl.column in a query header names a column the query does not select.in 1 example
- Q037errorOverride names a missing table columnA column type override, in sgl.yaml or an sgl.column in a migration, names a table.column that does not exist.in 1 example
- Q043warningMigration is not atomicA migration mixes a statement that cannot run in a transaction with other statements.in 1 example
- Q048warningMigration file ignoredA .sql file in the migrations directory is skipped because its name does not end in .up.sql or .down.sql.
- Q049errorUnusable go_typeA migration's go_type override names a type the generator cannot use.in 1 example
Q019 is retired and Q021 reserved: neither is ever assigned. Codes Q001 to Q049 began in Piko's querier and keep their meaning in Seagull.