Member Junction
    Preparing search index...

    The server-side WellKnownUserSource: resolves MJ's built-in accounts straight out of the core-schema user views.

    Why this lives here rather than in the dialect packages. Both SQLServerDataProvider and PostgreSQLDataProvider depend on this package, and this package depends on neither, so one registration here serves both dialects — the implementations would otherwise be identical. Any process holding a database provider has necessarily loaded this module, which makes "the registration exists" line up exactly with "this process has a Database provider". A registration in a server package like MJServer would instead leave every CLI and job process (MJCLI, CodeGen, MetadataSync, AICLI) silently without a system user.

    Cache first, query as the cold-start fallback. UserCache now lives in this same package, so reading it here is a plain in-process lookup rather than the inverted dependency it used to be. The query remains, and is load-bearing rather than vestigial:

    • It answers before any Refresh has run. A cold cache is the normal state for a process that resolves a system user during its own bootstrap, which is exactly when BaseEngine asks.
    • It answers when the cache was refreshed against a different connection. UserCache is a process-global singleton, so in a multi-connection host its contents are not necessarily this provider's users.

    Deliberately not memoized privately: a long-lived copy would drift from UserCache after a role sync, and that drift was the flaw in an earlier attempt at this. Reading the cache directly shares whatever every other UserCache consumer sees, so there is no second copy to go stale.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get Instance(): WellKnownUserSource

      The registered source for this process, resolved once through the class factory.

      Cached because IsSystemUser sits behind permission checks that run per entity and per user; resolving (and allocating) on every call would be needless churn. Registrations happen as module-load side effects of importing a data-provider package, which always precedes any permission evaluation, so caching cannot capture a stale answer in practice. Tests that register a source after first use should call ResetInstance.

      Returns WellKnownUserSource

    Methods

    • Drops the cached Instance so the next access re-resolves through the class factory. Intended for tests that register a source after the cache was populated.

      Returns void