Class ConstraintNames

java.lang.Object
dev.frostlake.metastore.model.ConstraintNames

public final class ConstraintNames extends Object
Names for constraints declared without an explicit CONSTRAINT <name> clause. Snowflake names such a constraint SYS_CONSTRAINT_<uuid> — e.g. SYS_CONSTRAINT_0a022251-e083-4354-a48d-a7cdffba5738 — for PRIMARY KEY, UNIQUE and FOREIGN KEY alike (live-verified through INFORMATION_SCHEMA.TABLE_CONSTRAINTS). The name carries no information about the table, the columns, or the constraint kind, so callers must never parse it; they only need it to stay stable for the lifetime of the constraint, which is why every generated name is memoized next to the constraint it names (see Table and ForeignKeyConstraint).
  • Field Details

    • PREFIX

      public static final String PREFIX
      The prefix Snowflake gives every auto-generated constraint name.
      See Also:
  • Method Details

    • generate

      public static String generate()
      A fresh auto-generated constraint name.