Table of Contents

Field MaximumOctets

Namespace
MailFathom.Infrastructure.Persistence.Users
Assembly
MailFathom.Infrastructure.dll

The largest user document this build binds, and therefore the largest one it will persist.

public const int MaximumOctets = 1048576

Returns

int
The largest user document this build binds, and therefore the largest one it will persist.

Remarks

jsonb holds up to a gigabyte, and this document is expanded three times over on its way to a bound aggregate — the string the driver materializes, the UTF-8 bytes the parser is handed, and the flattened dictionary the binder reads. A ceiling a user's declarations could plausibly reach would be the wrong ceiling; this one is far past every mail account and user-level setting one person configures, and far below anything the bind costs a thought, so a row past it is a row something went wrong with.

One bound rather than two, for the reason the deployment's document states: a write permitted past what the bind accepts would persist a record the next read refuses, and the user would be locked out by a change that had been accepted. It is applied in both places the document is expanded — in the statement that reads the row, where PostgreSQL measures the column and declines to send it, and in the binder, which is where a candidate nothing has persisted yet is measured. Both measure the same value, which is the rendering the database stores rather than the compact form a candidate is composed as: the binder gets it from RootSettingsCommitRules.PersistedOctetsOf, whose own remark says what measuring the compact form would cost.