Skip to content

harakeishi/sqlc-tidy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sqlc-tidy

sqlc-tidy is a tool that removes unused queries from the code generated by SQLC. It reads the sqlc configuration file, checks if the auto-generated queries are used in the code, and removes unused queries from the auto-generated files. Note that it does not delete auto-generated mocks, so after running sqlc-tidy, you need to run sqlc again to regenerate the auto-generated files.

Table of Contents

Installation

$ go install github.com/harakeishi/sqlc-tidy@latest

Usage

Run it in the directory where the sqlc configuration file is located.

$ sqlc-tidy

Below is the result of running sqlc-tidy in the testdata directory of this repository.

$ sqlc-tidy
==delete==
file: query.sql
query: ListAuthors
==delete==
file: query.sql
query: CreateAuthor
==delete==
file: query.sql
query: DeleteAuthor

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages