You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The drift files are a very convenient way of maintaining SQL queries but because the syntax is not exactly SQL, the IDE formatters (VS Code, Goland, etc.) can't work properly and format the file and / or show syntax errors.
This hinders productivity and can be a source of frustration sometimes.
Proposal
sqlc uses a slightly different approach, where metadata is written as a valid SQL comment instead.
-- name: GetAuthor :oneSELECT*FROM authors
WHERE id = $1;
I propose to add the support for something equivalent, without breaking compatibility.
-- import 'status.dart';-- createEntry:INSERT INTO todos (title, content) VALUES (:title, :content);
-- deleteById:DELETEFROM todos WHERE id = :id;
-- myQuery(:variable AS TEXT): SELECT :variable;
-- normal comments are still ignored-- current syntax still works
getTodos ($predicate = TRUE):
SELECT*FROM todos WHERE $predicate;
The parsing rule for queries would be something like:
the comment must end with :
the comment is followed by a query
The parsing rule for imports would be:
the comment must start with import and satisfy the current import parsing rule
The text was updated successfully, but these errors were encountered:
The drift files are a very convenient way of maintaining SQL queries but because the syntax is not exactly SQL, the IDE formatters (VS Code, Goland, etc.) can't work properly and format the file and / or show syntax errors.
This hinders productivity and can be a source of frustration sometimes.
Proposal
sqlc uses a slightly different approach, where metadata is written as a valid SQL comment instead.
I propose to add the support for something equivalent, without breaking compatibility.
The parsing rule for queries would be something like:
:
The parsing rule for imports would be:
The text was updated successfully, but these errors were encountered: