Class EmailSearchQueryText
- Namespace
- MailFathom.Application.Emails.Search
- Assembly
- MailFathom.Application.dll
The free text a caller is searching their mail for.
public sealed record EmailSearchQueryText : IEquatable<EmailSearchQueryText>
- Inheritance
-
EmailSearchQueryText
- Implements
- Inherited Members
Remarks
The text is never interpreted here. It is bounded and checked for characters no document could hold, and then travels to PostgreSQL as one parameter that the full-text parser turns into a query — so a caller's operators, quotes, and punctuation are data the parser reads rather than syntax anything composes with. Nothing in this type or below it concatenates the value into SQL.
It is a type of its own rather than a string parameter because it is the one untrusted value that reaches a query as text. A named type means the bound and the refusal are stated once, and a reader of the port signature can see that the text arriving there is the validated one.
Query text is personal data of a particularly revealing kind — what somebody is looking for in their own mailbox — so it is never logged and never repeated in a failure message.
Fields
- MaximumLength
The greatest number of characters a search query may carry.
Properties
- Value
Gets the query text as it will reach the full-text parser.
Methods
- Create(string?)
Validates and normalizes the text a request asked to search for.
- ToString()
Returns a string that represents the current object.