// GetAll returns all users.
GetAll returns all users.
// GetAll returns all users .
func (ur *UserRepository) GetAll(ctx context.Context) ([]user.User, error) {
	q := `
	SELECT id, first_name, last_name, username, email, picture,
		created_at, updated_at
		FROM users;
	`
	rows, err := ur.Data.DB.QueryContext(ctx, q)
	if err != nil {
		return nil, err
	}
	defer rows.Close()
	var users []user.User
	for rows.Next() {
		var u user.User
		rows.Scan(&u.ID, &u.FirstName, &u.LastName, &u.Username,
			&u.Email, &u.Picture, &u.CreatedAt, &u.UpdatedAt)
		users = append(users, u)
	}
	return users, nil
}
func ( ur * UserRepository ) GetAll ( ctx context . Context ) ( [ ] user . User , error ) { q := `
	SELECT id, first_name, last_name, username, email, picture,
		created_at, updated_at
		FROM users;
	` rows , err := ur . Data . DB . QueryContext ( ctx , q ) if err != nil { return nil , err } defer rows . Close ( ) var users [ ] user . User for rows . Next ( ) { var u user . User rows . Scan ( & u . ID , & u . FirstName , & u . LastName , & u . Username , & u . Email , & u . Picture , & u . CreatedAt , & u . UpdatedAt ) users = append ( users , u ) } return users , nil }
GetAll returns all users.
GetAll returns all users .