(ctx context.Context, opts *database.InsertUserOptions)
| 903 | } |
| 904 | |
| 905 | func (c *connection) InsertUser(ctx context.Context, opts *database.InsertUserOptions) (*database.User, error) { |
| 906 | if err := database.Validate(opts); err != nil { |
| 907 | return nil, err |
| 908 | } |
| 909 | |
| 910 | res := &database.User{} |
| 911 | err := c.getDB(ctx).QueryRowxContext(ctx, "INSERT INTO users (email, display_name, photo_url, quota_trial_orgs, quota_singleuser_orgs, superuser) VALUES ($1, $2, $3, $4, $5, $6) RETURNING *", opts.Email, opts.DisplayName, opts.PhotoURL, opts.QuotaTrialOrgs, opts.QuotaSingleuserOrgs, opts.Superuser).StructScan(res) |
| 912 | if err != nil { |
| 913 | return nil, parseErr("user", err) |
| 914 | } |
| 915 | return res, nil |
| 916 | } |
| 917 | |
| 918 | func (c *connection) CheckUsersEmpty(ctx context.Context) (bool, error) { |
| 919 | var res bool |