Skip to content

Use sqlx::query_file_as! macro #35

@n-dusan

Description

@n-dusan

The sql statements would go into a separate sql file. That would help us with syntax highlighting, keeping things more sane, etc.

Have you seen the sqlx::query_file_as! macro? https://github.com/launchbadge/sqlx/tree/main/examples/postgres/files It allows you to keep SQL statements in .sql files. I think it's something to bear in mind as SQL statements get bigger. It's obviously not critical, but I think being able to write SQL in actual .sql files helps keep SQL sane, because then we get things like editor syntax highlighting and linters like https://github.com/sqlfluff/sqlfluff

Originally posted by @tombh in #33 (comment)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions