sqlc-dev / sqlc

Generate type-safe code from SQL
https://sqlc.dev
MIT License
11.77k stars 755 forks source link

When use `:batchexec`, Generate file containing only the package name #3471

Open uh-zz opened 3 weeks ago

uh-zz commented 3 weeks ago

Version

1.26.0

What happened?

When use :batchexec, Generate file containing only the package name.

Create the following sql file

-- name:BulkInsertExample :batchexec
INSERT INTO examples VALUES (...);

Execute sqlc generate, generates code in batch.go. A file with the same name as the sql file is also generated as follows.

// Code generated by sqlc. DO NOT EDIT.
// versions:
//   sqlc v1.26.0
// source: source.sql

package sqlc

I think it would be good to avoid generating files with only the package name.

Related bellow

Relevant log output

No response

Database schema

No response

SQL queries

No response

Configuration

No response

Playground URL

https://play.sqlc.dev/p/3b62d895633e99177bc1fa8290883dfa81188310b9700c98f4e3f82a4c13f849

What operating system are you using?

Linux

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

orisano commented 3 weeks ago

Having the URL to the playground would help expedite the investigation of the issue. https://play.sqlc.dev

uh-zz commented 2 weeks ago

@orisano Thank you for confirming. I added the playground link to the description.