-
Notifications
You must be signed in to change notification settings - Fork 11
/
user_account.go
60 lines (51 loc) · 1.98 KB
/
user_account.go
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
57
58
59
60
package sqlqueries
import _ "embed"
// Holds the SQL query to return a user account by a given username
//
//go:embed SQL/user_account/get_by_username.sql
var userAccountGetByUsername string
// Holds the SQL query to return a user account by a common name
//
//go:embed SQL/user_account/get_by_common_name.sql
var userAccountGetByCommonName string
// Holds the SQL to return a user account for a given internal UUID
//
//go:embed SQL/user_account/get_by_id.sql
var userAccountGetByID string
// Holds the SQL to return a collection of user accounts for a collection of internal UUIDs
// this is meant to be used primarily by a data loader
//
//go:embed SQL/user_account/get_by_id_LOADER.sql
var userAccountGetByIDLOADER string
// Holds the SQL to create a new user account record
//
//go:embed SQL/user_account/create.sql
var userAccountCreate string
// Holds the SQL to update a user account record for a matching username
//
//go:embed SQL/user_account/update_by_username.sql
var userAccountUpdateByUsername string
// UserAccount holds all relevant SQL queries related to a user account
var UserAccount = userAccount{
GetByUsername: userAccountGetByUsername,
GetByCommonName: userAccountGetByCommonName,
GetByID: userAccountGetByID,
GetByIDLoader: userAccountGetByIDLOADER,
Create: userAccountCreate,
UpdateByUsername: userAccountUpdateByUsername,
}
type userAccount struct {
// Holds the SQL query to return a user account by a given username
GetByUsername string
// Holds the SQL query to return a user account by a common name
GetByCommonName string
// Holds the SQL to return a user account for a given internal UUID
GetByID string
// Holds the SQL to return a collection of user accounts for a collection of internal UUIDs
// this is meant to be used primarily by a data loader
GetByIDLoader string
// Holds the SQL to create a new user account record
Create string
// Holds the SQL to update a user account record for a matching username
UpdateByUsername string
}