Provides minisql server session facilities for this project.
Package: minisql.server.session
Reachable from entry: yes
minisql/catalog/catalog.mlascatalog→ src/minisql/catalog/catalog.mlminisql/catalog/metadata.mlasmetadata→ src/minisql/catalog/metadata.mlminisql/client/formatter.mlasformatter→ src/minisql/client/formatter.mlminisql/common/diagnostics.mlasdiagnostics→ src/minisql/common/diagnostics.mlminisql/common/logger.mlaslogger→ src/minisql/common/logger.mlminisql/common/uuid.mlasuuid→ src/minisql/common/uuid.mlminisql/executor/executor.mlasexecutor→ src/minisql/executor/executor.mlminisql/platform/clock.mlasclock→ src/minisql/platform/clock.mlminisql/protocol/connection.mlasprotocol_connection→ src/minisql/protocol/connection.mlminisql/protocol/constants.mlasconstants→ src/minisql/protocol/constants.mlminisql/protocol/messages.mlasmessages→ src/minisql/protocol/messages.mlminisql/server/database_manager.mlasdatabase_manager→ src/minisql/server/database_manager.mlminisql/sql/parser.mlasparser→ src/minisql/sql/parser.ml
function abortForConcurrency(session)Implements abort for concurrency for this module. Requires arguments that satisfy the validation performed below. Returns its result or propagates a structured error from validation or a dependency. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
function abortForConcurrencyTimeout(session)Aborts a logical lock wait at the absolute statement deadline while keeping the wire-compatible lock-timeout response code in the listener.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
function abortForConcurrencyUnlocked(session)Aborts an ordinary lock conflict without assigning a terminal control code.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
function abortForConcurrencyUnlockedWithCode(session, errorCode)Implements abort for concurrency unlocked for this module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
errorCode |
dynamic |
— | errorCode value consumed by this operation. |
function activateTransport(session, connection)Implements activate transport for this module. Returns the computed value or operation status. May mutate supplied state and perform I/O through its dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
connection |
dynamic |
— | connection value consumed by this operation. |
const AUTH_HANDSHAKE_TIMEOUT_MS = 30000Defines the auth handshake timeout ms constant used by the minisql server session module.
const AUTHENTICATION_FAILED = 9027Defines the authentication failed constant used by the minisql server session module.
const AUTHENTICATION_REQUIRED = 9028Defines the authentication required constant used by the minisql server session module.
function authenticationBackoff(session)Implements authentication backoff for this module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
function authenticationError(request)Implements authentication error for this module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
request |
dynamic |
— | request value consumed by this operation. |
function beginTrackedStatement(session, sqlText)Begins metrics tracking exactly once across cooperative lock-wait retries.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
sqlText |
dynamic |
— | sqlText value consumed by this operation. |
function clearPending(session)Implements clear pending for this module. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. May mutate supplied state as documented by the operation name.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
function close(session)Closes close owned by the minisql server session module. Requires arguments that satisfy the validation performed below. Returns its result or propagates a structured error from validation or a dependency. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
const CLOSED_HANDLE = 9008Defines the closed handle constant used by the minisql server session module.
function closeUnlocked(session)Closes unlocked using the supplied inputs. Requires arguments that satisfy the validation performed below. Returns its result or propagates a structured error from validation or a dependency. May mutate supplied state as documented by the operation name.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
function componentName()Performs the componentName operation for the minisql server session module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
function createSession(engine, secure, authenticated)Creates session using the supplied inputs. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
engine |
dynamic |
— | engine value consumed by this operation. |
secure |
dynamic |
— | secure value consumed by this operation. |
authenticated |
dynamic |
— | authenticated value consumed by this operation. |
function executeParsedQuery(session, request, statement)Executes an already parsed statement through the ordinary materializing API. Keeping this tail separate lets the network streaming path reuse parsing, authorization errors, and the exact fallback response contract.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
request |
dynamic |
— | request value consumed by this operation. |
statement |
dynamic |
— | statement value consumed by this operation. |
function fail(code, operation, message)Performs the fail operation for the minisql server session module. Returns its result or propagates a structured error from validation or a dependency. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
code |
dynamic |
— | code value consumed by this operation. |
operation |
dynamic |
— | operation value consumed by this operation. |
message |
dynamic |
— | Human-readable message associated with the operation. |
function fakeAuthenticationMaterial(session, username)Implements fake authentication material for this module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
username |
dynamic |
— | username value consumed by this operation. |
function finishTrackedStatement(session, success, rowCount)Compatibility helper for ordinary outcomes without a production-control code.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
success |
dynamic |
— | success value consumed by this operation. |
rowCount |
dynamic |
— | Number of row to process. |
function finishTrackedStatementWithCode(session, success, rowCount, errorCode)Completes metrics, latency, budget and slow-query tracking.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
success |
dynamic |
— | success value consumed by this operation. |
rowCount |
dynamic |
— | Number of row to process. |
errorCode |
dynamic |
— | errorCode value consumed by this operation. |
function handle(session, request)Handles handle using the supplied inputs. Requires arguments that satisfy the validation performed below. Returns its result or propagates a structured error from validation or a dependency. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
request |
dynamic |
— | request value consumed by this operation. |
function handleAuthBegin(session, request)Handles auth begin using the supplied inputs. Requires arguments that satisfy the validation performed below. Returns its result or propagates a structured error from validation or a dependency. May mutate supplied state as documented by the operation name.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
request |
dynamic |
— | request value consumed by this operation. |
function handleAuthProof(session, request)Handles auth proof using the supplied inputs. Requires arguments that satisfy the validation performed below. Returns its result or propagates a structured error from validation or a dependency. May mutate supplied state as documented by the operation name.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
request |
dynamic |
— | request value consumed by this operation. |
function handleQuery(session, request)Handles query using the supplied inputs. Requires arguments that satisfy the validation performed below. Returns its result or propagates a structured error from validation or a dependency. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
request |
dynamic |
— | request value consumed by this operation. |
function handleQueryStreaming(session, request, connection)Streams an eligible non-blocking SELECT directly to one connection. One protocol frame plus one look-ahead frame are retained, so both server and cursor-aware client memory remain bounded while FLAG_MORE stays exact.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
request |
dynamic |
— | request value consumed by this operation. |
connection |
dynamic |
— | connection value consumed by this operation. |
function handleToConnection(session, request, connection)Handles a request and, for eligible SELECTs, writes response batches directly to the supplied protocol connection. An empty array means delivery completed.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
request |
dynamic |
— | request value consumed by this operation. |
connection |
dynamic |
— | connection value consumed by this operation. |
function handleUnlocked(session, request)Handles unlocked using the supplied inputs. Returns the computed value or operation status. May mutate supplied state as documented by the operation name.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
request |
dynamic |
— | request value consumed by this operation. |
function idleTimeoutMilliseconds()Implements idle timeout milliseconds for this module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
const INVALID_ARGUMENT = 9001Defines the invalid argument constant used by the minisql server session module.
const IO_FAILURE = 9005Defines the io failure constant used by the minisql server session module.
function isExpired(session)Returns whether the supplied value satisfies the expired condition. Returns the computed value or operation status. Does not modify its inputs.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
function isImplemented()Returns whether implemented satisfies the condition required by the minisql server session module. Returns the computed value or operation status. Does not modify its inputs.
function isSession(value)Returns whether the supplied value satisfies the session condition. Returns the computed value or operation status. Does not modify its inputs.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
dynamic |
— | Value consumed or transformed by the operation. |
function open(databasePath)Opens open for the minisql server session module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
databasePath |
dynamic |
— | Path associated with database. |
function openAttached(database)Opens attached using the supplied inputs. Requires arguments that satisfy the validation performed below. Returns its result or propagates a structured error from validation or a dependency. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
database |
dynamic |
— | database value consumed by this operation. |
function openSecure(databasePath)Opens secure using the supplied inputs. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
databasePath |
dynamic |
— | Path associated with database. |
function openSecureAttached(database)Opens secure attached using the supplied inputs. Requires arguments that satisfy the validation performed below. Returns its result or propagates a structured error from validation or a dependency. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
database |
dynamic |
— | database value consumed by this operation. |
function prepareAttachedDatabase(database)Completes process-local database preparation before the listener advertises readiness, so the first client's HELLO does not pay the full index audit cost.
| Parameter | Type | Default | Description |
|---|---|---|---|
database |
dynamic |
— | database value consumed by this operation. |
function responseMessage(request, response)Implements response message for this module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
request |
dynamic |
— | request value consumed by this operation. |
response |
dynamic |
— | response value consumed by this operation. |
function responseMessages(request, responses)Encodes bounded result batches and marks every non-final frame for the client.
| Parameter | Type | Default | Description |
|---|---|---|---|
request |
dynamic |
— | request value consumed by this operation. |
responses |
dynamic |
— | responses value consumed by this operation. |
- minisql.server.session.Session — struct
const SESSION_IDLE_TIMEOUT_MS = 300000Legacy public default retained for embedded callers and compatibility tests.
function sessionIdentifier(session)Implements session identifier for this module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
const STREAM_RESULT_ROWS = 64A server cursor retains at most this many arbitrarily wide SQL rows before
function targetMilestone()Performs the targetMilestone operation for the minisql server session module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
function touch(session)Implements touch for this module. Returns the computed value or operation status. May mutate supplied state as documented by the operation name.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
function transportReady(session)Implements transport ready for this module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
const UNSUPPORTED_SQL = 9025Defines the unsupported sql constant used by the minisql server session module.
function validateOpen(session, operation)Validates open for the minisql server session workflow. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |
operation |
dynamic |
— | operation value consumed by this operation. |
function waitingForConcurrency(session)Returns whether this session still has a logical lock blocker. The check is side-effect free and lets the listener suspend a request without executing it repeatedly while another explicit transaction owns the writer lock.
| Parameter | Type | Default | Description |
|---|---|---|---|
session |
dynamic |
— | session value consumed by this operation. |