sqlc

package
v0.1.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Query

type Query struct {
	Model       string   // 파일명 단수화 + PascalCase (e.g. "users.sql" → "User")
	Name        string   // 쿼리 이름 (모델 prefix 제거 후, e.g. "FindByEmail")
	Cardinality string   // "one" / "many" / "exec"
	Params      []string // $1, $2 순서의 PascalCase 파라미터 이름
}

Query는 sqlc 쿼리 파일(`.sql`) 의 `-- name: Xxx :one` 항목 하나를 나타낸다.

func ParseDir

func ParseDir(dir string) ([]Query, []diagnostic.Diagnostic)

ParseDir는 주어진 디렉토리의 *.sql 파일을 순회하며 sqlc 쿼리를 추출한다. 디렉토리가 없으면 nil, nil 을 반환한다.

func ParseFile

func ParseFile(path string) ([]Query, []diagnostic.Diagnostic)

ParseFile는 단일 `.sql` 파일에서 `-- name: Xxx :card` 항목을 추출한다.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL