SmartQueryAdapter
Wisej.AI.Adapters.SmartQueryAdapter
Namespace: Wisej.AI.Adapters
Assembly: Wisej.AI (3.5.0.0)
Represents an adapter that generates a data set from a database schema and a user-provided description.
public class SmartQueryAdapter : SmartAdapter
The SmartQueryAdapter class is designed to interact with a database schema and generate SQL queries based on user input. It utilizes a SmartPrompt to facilitate the query generation process.
Constructors
SmartQueryAdapter()

Initializes a new instance of the SmartQueryAdapter class.
Properties
Connection

IDbConnection: Gets or sets the database connection used to execute the query.
DataSource

BindingSource: Gets or sets the data source binding for the query results.
Query

String: Gets or sets the query description provided by the user.
When the AutoRun property is set to true, setting this property will automatically execute the query asynchronously.
Schema

DataTable: Gets or sets the database schema used to generate the query.
ServerType

String: Gets or sets the type of the database server. (Default: "Microsoft Sql Server"
)
SQL

String: Gets the SQL statement generated from the query description.
Methods
GetSQL(message)

Returns the JSON string returned in the message by stripping the enclosing markers (sql and
) if present.
Returns: String. JSON string.
RunAsyncCore(control)

Asynchronously runs the core logic to generate and execute the SQL query.
Returns: Task<Message>. A task representing the asynchronous operation, with a Message result containing the query execution details.
Implements
Represents a provider that supplies tools.
Last updated