Skip to content

Include comments inside the generated SQL statement #2207

Open
@fr3fou

Description

@fr3fou

What do you want to change?

Hi!

I'd like to use sqlmw interceptors with sqlcache.
sqlcache relies on query "annotations", like so:

-- name: GetUsers :many
-- @cache-ttl 30
-- @cache-max-rows 10
SELECT * FROM users;

However, upon generating the code, those comments get stripped out and instead got shoved on top of the generated Go method. Is there a way to prevent this from happening?

// @cache-ttl 30
// @cache-max-rows 10
func (q *Queries) GetUsers(ctx context.Context) ([]User, error) {

What database engines need to be changed?

PostgreSQL

What programming language backends need to be changed?

Go

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions