MssqlCapabilityCache class

Shared dialect resolution for one server and one database.

Asking SERVERPROPERTY and sys.databases once per repository was a round-trip per table getter. Two repositories of the same database — and two callers that race — share one in-flight Future keyed by host, port and the session's current database. A USE that changes the database is a different key, not a stale answer. An explicit invalidate is the answer after a reconnect or a compatibility-level change.

This is not a compilation cache of user SQL. Caching raw query text would pin tenant values in a process-wide map with no bound.

Constructors

MssqlCapabilityCache()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

invalidate({MssqlSession? session}) → void
Drops a cached dialect so the next resolve asks the server again.
keyFor(MssqlSession session) String
Host, port and current database — not the login catalog, and not a connection identity. Two leases of the same database share; a USE does not.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolve(MssqlSession session) Future<MssqlDialect>
The dialect for session, asking the server at most once per key.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

shared MssqlCapabilityCache
Process-wide cache used when a repository or context was not given one.
final