43 lines
784 B
Go
43 lines
784 B
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.25.0
|
|
// source: regions.sql
|
|
|
|
package db
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
const getListRegions = `-- name: GetListRegions :many
|
|
SELECT
|
|
id,
|
|
region_name
|
|
FROM regions
|
|
`
|
|
|
|
type GetListRegionsRow struct {
|
|
ID int32 `json:"id"`
|
|
RegionName string `json:"region_name"`
|
|
}
|
|
|
|
func (q *Queries) GetListRegions(ctx context.Context) ([]GetListRegionsRow, error) {
|
|
rows, err := q.db.Query(ctx, getListRegions)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
defer rows.Close()
|
|
items := []GetListRegionsRow{}
|
|
for rows.Next() {
|
|
var i GetListRegionsRow
|
|
if err := rows.Scan(&i.ID, &i.RegionName); err != nil {
|
|
return nil, err
|
|
}
|
|
items = append(items, i)
|
|
}
|
|
if err := rows.Err(); err != nil {
|
|
return nil, err
|
|
}
|
|
return items, nil
|
|
}
|