Class ShowResultHelpers

java.lang.Object
dev.frostlake.executor.ShowResultHelpers

public final class ShowResultHelpers extends Object
Small stateless helpers shared by more than one SHOW/DESCRIBE sub-executor. Kept in one place so the describe-result plumbing is not duplicated across the Show*Executor family.
  • Field Details

    • OWNER_ROLE_TYPE

      public static final String OWNER_ROLE_TYPE
      Every SHOW listing reports role ownership; the engine has no user-owned objects.
      See Also:
    • CREATED_ON

      public static final DateTimeType CREATED_ON
      The type every SHOW and DESCRIBE created_on column declares: TIMESTAMP_LTZ at precision THREE — SYSTEM$TYPEOF("created_on") over a RESULT_SCAN of SHOW TABLES, SHOW SEQUENCES, SHOW SCHEMAS, SHOW DATABASES or SHOW VIEWS reads TIMESTAMP_LTZ(3)[SB8] on the account — which is also the precision the cells carry (see createdOn(Instant)).
  • Method Details

    • text

      public static String text(String value)
    • renderDefaultExpression

      public static String renderDefaultExpression(Object def)
      A column default rendered as the EXPRESSION live prints — a string default keeps its quotes ('active', embedded quotes doubled), numbers/booleans/keyword defaults and sequence expressions print verbatim. DESCRIBE TABLE's default cell and GET_DDL share this one rendering (live-verified on the DESCRIBE side: DEFAULT 'active' reads back as 'active', not active).
    • matchesLike

      public static boolean matchesLike(String value, String pattern)
      SQL LIKE match (case-insensitive, % and _ wildcards) for SHOW … LIKE filters.
    • ownerRoleType

      public static String ownerRoleType(String owner)
      The owner_role_type that goes with owner. An object nobody owns — INFORMATION_SCHEMA is the one the engine has — leaves BOTH columns empty rather than naming a role type for an owner that is not there.
    • createdOn

      public static OffsetDateTime createdOn(Instant createdTime)
    • createdOn

      public static OffsetDateTime createdOn(LocalDateTime createdTime)
      As createdOn(Instant), for the models that stamp a HOST-LOCAL wall clock: read back in the host's zone, the instant is recovered exactly.