hiling_go/db/sqlc/regencies.sql.go

48 lines
945 B
Go

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.20.0
// source: regencies.sql
package db
import (
"context"
)
const getListRegencies = `-- name: GetListRegencies :many
SELECT
id,
regency_name,
province_id
FROM regencies
`
type GetListRegenciesRow struct {
ID int32 `json:"id"`
RegencyName string `json:"regency_name"`
ProvinceID int16 `json:"province_id"`
}
func (q *Queries) GetListRegencies(ctx context.Context) ([]GetListRegenciesRow, error) {
rows, err := q.db.QueryContext(ctx, getListRegencies)
if err != nil {
return nil, err
}
defer rows.Close()
items := []GetListRegenciesRow{}
for rows.Next() {
var i GetListRegenciesRow
if err := rows.Scan(&i.ID, &i.RegencyName, &i.ProvinceID); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Close(); err != nil {
return nil, err
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}