Skip to main content

Module db2

Module db2 

Source
Expand description

Db2 client: NetGet speaks DRDA to IBM Db2 or Apache Derby and the model decides what SQL to run. See AGENTS.md beside this file.

Two tasks per connection, both registered with the client so stop_client ends them:

  • the session owns the socket. It runs the handshake before connect returns, then executes one action at a time — the model’s, or one injected from the dashboard or MCP — as a DRDA request and its whole reply, and turns the reply into an event.
  • the turns task asks the model about each event and hands the actions it answers with back to the session. Each event carries the number of model turns that led to it; past MAX_FOLLOWUP_DEPTH the model is not asked again.

Fail closed: a refused login fails connect and the model is never asked anything; an LLM failure sends nothing; a reply this client cannot read, a timeout or a server that hangs up ends the connection with an error rather than inventing a result.

Re-exports§

pub use actions::Db2ClientProtocol;

Modules§

actions
Db2 (DRDA) client: what the model is told and what it may do.
wire
DRDA in the requesting role: the Db2 client’s codec.

Structs§

Conn
One DRDA connection, after or during the handshake.
ServerInfo
What the server said about itself during the handshake.

Constants§

DEFAULT_AUTOCOMMIT
DEFAULT_PORT
The port a remote address without one is given: Db2’s default instance port.
DEFAULT_PRODUCT_ID
Apache Derby admits only product ids containing its own client’s DNC; Db2 accepts any.
MAX_FOLLOWUP_DEPTH
How many model turns may follow from one another before the chain stops.
REPLY_TIMEOUT
How long a whole reply may take. A statement can wait on a lock (Derby’s default lock timeout is a minute), so this is generous; past it the connection is given up.

Functions§

connect

Type Aliases§

Done
What one action produced: the event to raise.