Package dev.frostlake.values
Class VariantJsonFormat
java.lang.Object
dev.frostlake.values.VariantJsonFormat
Renders a semi-structured value the way Snowflake displays one: indented by JSON_INDENT spaces,
compact at zero. An empty array or object stays on one line either way. The indented form is
byte-identical to a real account's at the same width.
The width is per session, so it is bound to the calling thread for the duration of a statement — the same shape the catalog and transaction manager use for their session scopes. Nothing else about the value changes: equality, ordering and hashing all stay on the canonical compact text.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe width this engine uses when a session has not set one. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbeginSessionScope(int indent) Bind this session's JSON_INDENT to the calling thread for one statement.static voidDrop this thread's JSON_INDENT binding.static intindent()The width in force: the session's when one is bound, else Snowflake's default.static Stringnoderendered at the width in force.
-
Field Details
-
DEFAULT_INDENT
public static final int DEFAULT_INDENTThe width this engine uses when a session has not set one. Snowflake's own JSON_INDENT default is 2; this engine's canonical rendering is COMPACT, and the live-comparison harness pins the server to JSON_INDENT = 0 so both sides emit the same text. Setting the parameter gives live's rendering at any width — only the unset default differs.- See Also:
-
-
Method Details
-
beginSessionScope
public static void beginSessionScope(int indent) Bind this session's JSON_INDENT to the calling thread for one statement. -
clearSessionScope
public static void clearSessionScope()Drop this thread's JSON_INDENT binding. Idempotent. -
indent
public static int indent()The width in force: the session's when one is bound, else Snowflake's default. -
render
noderendered at the width in force.compactText, the value's compact display text, is returned unchanged at width zero, so the common case costs nothing.
-