Record Class DatabaseConnectionConfig

java.lang.Object
java.lang.Record
com.darkcollective.relix.lang.ast.source.DatabaseConnectionConfig
Record Components:
url - the JDBC connection URL; must not be blank
user - the connection user, if any
password - the connection password, if any
dialect - the SQL dialect hint (e.g. "postgres"), if given

public record DatabaseConnectionConfig(String url, Optional<String> user, Optional<String> password, Optional<String> dialect) extends Record
Configuration for a named database connection — the JDBC coordinates shared by every table referenced through it.

Introduced by a connection NAME from database { … } declaration. Unlike a DatabaseSourceConfig (which names a single table inline), a connection is referenced by many tables, either as conn.table or via a source T from conn { … } binding.

url, user, and password may contain ${VAR} placeholders, resolved when a query runs. user and password are optional (some drivers, e.g. embedded H2, need neither); dialect is an optional hint that later drives SQL generation for pushdown.

  • Constructor Details

    • DatabaseConnectionConfig

      public DatabaseConnectionConfig(String url, Optional<String> user, Optional<String> password, Optional<String> dialect)
      Creates an instance of a DatabaseConnectionConfig record class.
      Parameters:
      url - the value for the url record component
      user - the value for the user record component
      password - the value for the password record component
      dialect - the value for the dialect record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • url

      public String url()
      Returns the value of the url record component.
      Returns:
      the value of the url record component
    • user

      public Optional<String> user()
      Returns the value of the user record component.
      Returns:
      the value of the user record component
    • password

      public Optional<String> password()
      Returns the value of the password record component.
      Returns:
      the value of the password record component
    • dialect

      public Optional<String> dialect()
      Returns the value of the dialect record component.
      Returns:
      the value of the dialect record component