-
Notifications
You must be signed in to change notification settings - Fork 610
Expand file tree
/
Copy pathapp_environment_variables_find.sql_generated.go
More file actions
56 lines (50 loc) · 1.32 KB
/
app_environment_variables_find.sql_generated.go
File metadata and controls
56 lines (50 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.30.0
// source: app_environment_variables_find.sql
package db
import (
"context"
)
const findAppEnvVarsByAppAndEnv = `-- name: FindAppEnvVarsByAppAndEnv :many
SELECT ` + "`" + `key` + "`" + `, value
FROM app_environment_variables
WHERE app_id = ?
AND environment_id = ?
`
type FindAppEnvVarsByAppAndEnvParams struct {
AppID string `db:"app_id"`
EnvironmentID string `db:"environment_id"`
}
type FindAppEnvVarsByAppAndEnvRow struct {
Key string `db:"key"`
Value string `db:"value"`
}
// FindAppEnvVarsByAppAndEnv
//
// SELECT `key`, value
// FROM app_environment_variables
// WHERE app_id = ?
// AND environment_id = ?
func (q *Queries) FindAppEnvVarsByAppAndEnv(ctx context.Context, db DBTX, arg FindAppEnvVarsByAppAndEnvParams) ([]FindAppEnvVarsByAppAndEnvRow, error) {
rows, err := db.QueryContext(ctx, findAppEnvVarsByAppAndEnv, arg.AppID, arg.EnvironmentID)
if err != nil {
return nil, err
}
defer rows.Close()
var items []FindAppEnvVarsByAppAndEnvRow
for rows.Next() {
var i FindAppEnvVarsByAppAndEnvRow
if err := rows.Scan(&i.Key, &i.Value); 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
}