type postgresUserRepo struct {
109
+
// GetByDIDs retrieves multiple users by their DIDs in a single query
110
+
// Returns a map of DID -> User for efficient lookups
111
+
// Missing users are not included in the result map (no error for missing users)
112
+
func (r *postgresUserRepo) GetByDIDs(ctx context.Context, dids []string) (map[string]*users.User, error) {
114
+
return make(map[string]*users.User), nil
117
+
// Build parameterized query with IN clause
118
+
// Use ANY($1) for PostgreSQL array support with pq.Array() for type conversion
119
+
query := `SELECT did, handle, pds_url, created_at, updated_at FROM users WHERE did = ANY($1)`
121
+
rows, err := r.db.QueryContext(ctx, query, pq.Array(dids))
123
+
return nil, fmt.Errorf("failed to query users by DIDs: %w", err)
128
+
result := make(map[string]*users.User, len(dids))
131
+
err := rows.Scan(&user.DID, &user.Handle, &user.PDSURL, &user.CreatedAt, &user.UpdatedAt)
133
+
return nil, fmt.Errorf("failed to scan user row: %w", err)
138
+
if err = rows.Err(); err != nil {
139
+
return nil, fmt.Errorf("error iterating user rows: %w", err)