MCPcopy Index your code
hub / github.com/rilldata/rill / InsertUser

Method InsertUser

admin/database/postgres/postgres.go:905–916  ·  view source on GitHub ↗
(ctx context.Context, opts *database.InsertUserOptions)

Source from the content-addressed store, hash-verified

903}
904
905func (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
918func (c *connection) CheckUsersEmpty(ctx context.Context) (bool, error) {
919 var res bool

Callers

nothing calls this directly

Calls 3

getDBMethod · 0.95
ValidateFunction · 0.92
parseErrFunction · 0.85

Tested by

no test coverage detected