TablesProvider

org.sigilaris.core.application.module.provider.TablesProvider
See theTablesProvider companion object
trait TablesProvider[F[_], Provides <: Tuple]

Provider for external table dependencies.

TablesProvider is the canonical handle for supplying tables that a module needs but does not own. The name "Provider" highlights what it supplies, while blueprints declare what they need via the Needs type parameter.

This is the core abstraction introduced in Phase 5.5 to replace nested dependency tuples with a clean dependency injection model.

Key design principles:

  • Provides is a tuple of Entry types (Entry[Name, K, V] *: ...)
  • At runtime, provides a Tables[F, Provides] instance
  • Blueprints declare Needs (also an Entry tuple) and receive a matching TablesProvider[F, Needs]
  • Compile-time evidence ensures type safety between Needs and Provides

Type parameters

F

the effect type

Provides

the tuple of Entry types this provider supplies

Attributes

Companion
object
Source
TablesProvider.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def tables: Tables[F, Provides]

Get the provided tables.

Get the provided tables.

Attributes

Returns

a tuple of StateTable instances matching the Provides schema

Source
TablesProvider.scala

Concrete methods

def narrow[Subset <: Tuple](using projection: TablesProjection[F, Subset, Provides]): TablesProvider[F, Subset]

Narrow this provider to a subset of its schema.

Narrow this provider to a subset of its schema.

This is critical for Phase 5.6 provider composition. When a merged provider (N1 ++ N2) is passed to a reducer expecting only N1, we must actually project the tables tuple, not just cast the type.

Without projection, pattern matching fails: val (accountsTable *: EmptyTuple) = provider.tables // MatchError!

Type parameters

Subset

the subset schema to project to

Value parameters

projection

evidence that Subset can be projected from Provides

Attributes

Returns

a provider supplying only the Subset tables (actually projected)

Source
TablesProvider.scala