Appearance
UserRegistry
Global Durable Object providing a user index by wallet and email for admin search with case-insensitive prefix matching.
Purpose
Maintains a global index of all users for admin lookup operations. Designed for low-QPS admin usage, not user-facing queries. Supports searching by wallet address or email with prefix matching.
- Single global instance (id:
"global") - Case-insensitive storage (wallet and email normalized to lowercase)
- Prefix-based search via SQL
LIKEwithquery%pattern
Edge Cases
- Upsert semantics --
registerUseris safe to call multiple times. Existing records are updated, not duplicated. - Email update before registration --
updateEmailsilently returns{ updated: false }if the user record does not exist yet; no error thrown. - Case normalization -- all wallet addresses and emails are lowercased before storage and before query, ensuring case-insensitive matching.
- Prefix-only search --
lookupusesLIKE 'query%', so only prefix matches are supported (no substring or fuzzy search). - Limit capping --
lookupcaps limit at 100 regardless of input.