Record Class DatabaseSourceConfig
java.lang.Object
java.lang.Record
com.darkcollective.relix.lang.ast.source.DatabaseSourceConfig
- Record Components:
url- the JDBC connection URL; must not be blanktable- the database table or view name; must not be blankcolumns- the ordered column specifications; must not be emptyreferences- the declared column references; may be empty
- All Implemented Interfaces:
SourceConfig
public record DatabaseSourceConfig(String url, String table, List<ColumnSpec> columns, List<ColumnReference> references)
extends Record
implements SourceConfig
Configuration for a database-backed source (JDBC table or view).
Example:
source Users from database {
url: "${DB_URL}",
table: "users",
schema: {
id: NUMBER,
name: STRING,
email: STRING
}
};
All columns in a database source are implicitly ColumnDirection.OUT;
predicate pushdown to SQL WHERE clauses is handled by the execution
layer based on column names, not by explicit IN bindings.
The url value may contain ${VAR} environment references.
An optional references: block declares foreign-key style
relationships from this source's columns to other relations:
references: { customer_id -> Customers.customer_id }
-
Constructor Summary
ConstructorsConstructorDescriptionDatabaseSourceConfig(String url, String table, List<ColumnSpec> columns) Creates a config with no declared references.DatabaseSourceConfig(String url, String table, List<ColumnSpec> columns, List<ColumnReference> references) Creates an instance of aDatabaseSourceConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncolumns()Returns the value of thecolumnsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thereferencesrecord component.table()Returns the value of thetablerecord component.final StringtoString()Returns a string representation of this record class.url()Returns the value of theurlrecord component.
-
Constructor Details
-
DatabaseSourceConfig
public DatabaseSourceConfig(String url, String table, List<ColumnSpec> columns, List<ColumnReference> references) Creates an instance of aDatabaseSourceConfigrecord class.- Parameters:
url- the value for theurlrecord componenttable- the value for thetablerecord componentcolumns- the value for thecolumnsrecord componentreferences- the value for thereferencesrecord component
-
DatabaseSourceConfig
Creates a config with no declared references.
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
url
Returns the value of theurlrecord component.- Returns:
- the value of the
urlrecord component
-
table
Returns the value of thetablerecord component.- Returns:
- the value of the
tablerecord component
-
columns
Returns the value of thecolumnsrecord component.- Returns:
- the value of the
columnsrecord component
-
references
Returns the value of thereferencesrecord component.- Returns:
- the value of the
referencesrecord component
-