SelectBuilderBase constructor

SelectBuilderBase({
  1. required String primaryTableKey,
  2. required SupabaseTableInfo currentTableInfo,
  3. String tableAlias = 't0',
})

Constructs a SelectBuilderBase.

  • primaryTableKey: The name of the primary key column for currentTableInfo. While this could be derived from currentTableInfo.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.",
    );
  }
}