SelectBuilderBase constructor
SelectBuilderBase({
- required String primaryTableKey,
- required SupabaseTableInfo currentTableInfo,
- String tableAlias = 't0',
Constructs a SelectBuilderBase.
primaryTableKey
: The name of the primary key column forcurrentTableInfo
. While this could be derived fromcurrentTableInfo.primaryKeys
, passing it explicitly can simplify logic or handle cases with composite/no standard PK.currentTableInfo
: The SupabaseTableInfo for the table this builder targets.
Implementation
SelectBuilderBase({
required this.primaryTableKey,
required this.currentTableInfo,
this.tableAlias = 't0',
}) {
if (primaryTableKey != currentTableInfo.uniqueKey &&
currentTableInfo.uniqueKey.isNotEmpty) {
_logger.warning(
"SupabaseSelectBuilderBase for table '${currentTableInfo.originalName}' initialized with primaryTableKey '$primaryTableKey' which does not match currentTableInfo.uniqueKey '${currentTableInfo.uniqueKey}'. This might indicate an issue if uniqueKey is the intended primary identifier.",
);
} else if (currentTableInfo.uniqueKey.isEmpty &&
primaryTableKey.isNotEmpty) {
_logger.info(
"SupabaseSelectBuilderBase for table '${currentTableInfo.originalName}' initialized with primaryTableKey '$primaryTableKey', but currentTableInfo.uniqueKey is empty. Ensure '$primaryTableKey' is a valid identifier for selection.",
);
}
}