sqlc icon indicating copy to clipboard operation
sqlc copied to clipboard

Can't generate only schema without queries

Open qanghaa opened this issue 1 year ago • 3 comments

What do you want to change?

Context:

  • Techstack I'm used:
    • go version go1.21.6 linux/amd64
    • kjconroy/sqlc:latest image
    • config yaml file: v2
  • I want to replace generated queries generated and query.go file
  • I'd do somethings like:
    • remove field queries => I got a error: error parsing queries: no queries contained in paths
    • write query but not using it => work, but exists query.go file generated? this way is so stupid LOL

My expectation:

  • If ignore field queries in yaml file, sqlc'll only generate schema to struct

What database engines need to be changed?

PostgreSQL

What programming language backends need to be changed?

Go

qanghaa avatar Mar 23 '24 07:03 qanghaa

Hello I was looking for something similar as well (just generate models.go). I can help with the implementation if needed!

pixelsoccupied avatar Oct 27 '24 21:10 pixelsoccupied

+1

adlion avatar Feb 01 '25 19:02 adlion

Or if the .sql file with queries is empty, just ignore it without any explicit instructions in the .yaml file.

Chapalax avatar Dec 02 '25 08:12 Chapalax