Documentation
Table of Contents

Class SemanticDatabase

Namespace
IntentSharp.Data
Assembly
IntentSharp.dll

Natural-language access to a database. Discovers the schema, asks the model for a parameterized statement, runs it through the SQL safety check, and executes only what passes. Read-only unless AllowWrites is set; dry-run returns the plan without touching the database.

public sealed class SemanticDatabase
Inheritance
object
SemanticDatabase
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Extension Methods

Constructors

SemanticDatabase(IntentClient, DbConnection, DatabaseOptions?, ISchemaDiscovery?)

Creates the runtime over an existing connection. A closed connection is opened for each operation and closed again; an open one is left open. The connection is never disposed.

Properties

Options

What this runtime may do.

Methods

ExecutePlanAsync(QueryPlan, CancellationToken)

Executes a plan that the caller has already reviewed (for example after a dry run). The safety check still runs.

GetSchemaAsync(bool, CancellationToken)

Returns the (cached) schema the model will see.

PlanAsync(string, CancellationToken)

Asks the model for a statement and checks it. Nothing is executed.

QueryAsync(string, CancellationToken)

Plans and, unless DryRun is set, executes a query for the intent.

UpsertAsync(string, object, string?, CancellationToken)

Inserts or updates rows from a .NET object or collection into tableName, letting the model map source fields to target columns. Requires AllowWrites. With DryRun, returns the plan only. The statement must be one INSERT, UPDATE or MERGE that references no table but tableName, whatever AllowedTables allows; a DELETE anywhere in it is refused.