hiling_go/db/sqlc/provinces.sql.go
2024-02-06 11:55:25 +07:00

45 lines
879 B
Go

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.25.0
// source: provinces.sql
package db
import (
"context"
)
const getListProvinces = `-- name: GetListProvinces :many
SELECT
id,
province_name,
region_id
FROM PROVINCES
`
type GetListProvincesRow struct {
ID int32 `json:"id"`
ProvinceName string `json:"province_name"`
RegionID int16 `json:"region_id"`
}
func (q *Queries) GetListProvinces(ctx context.Context) ([]GetListProvincesRow, error) {
rows, err := q.db.Query(ctx, getListProvinces)
if err != nil {
return nil, err
}
defer rows.Close()
items := []GetListProvincesRow{}
for rows.Next() {
var i GetListProvincesRow
if err := rows.Scan(&i.ID, &i.ProvinceName, &i.RegionID); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}