Class DatabaseImportTool
A built-in tool for importing CSV data into a SQLite database table.
Parses CSV content, optionally creates the target table from headers, and inserts all rows in a single transaction for performance.
public sealed class DatabaseImportTool : IBuiltInTool, ITool, IToolMetadata
- Inheritance
-
DatabaseImportTool
- Implements
- Inherited Members
Examples
var options = new DatabaseToolOptions { AllowWrite = true, AllowDdl = true };
var importTool = new DatabaseImportTool(options);
var result = await importTool.InvokeAsync(@"{""database"":""data.db"",""table"":""users"",""csv"":""name,age\nAlice,30\nBob,25""}");
Constructors
- DatabaseImportTool()
Initializes a new instance with default options.
- DatabaseImportTool(DatabaseToolOptions)
Initializes a new instance with the specified options.
Properties
- Description
Gets a concise description of what the tool does.
- InputSchema
Gets the JSON Schema defining the expected input arguments.
- Name
Gets the stable, unique identifier for this tool.
Methods
- InvokeAsync(string, CancellationToken)
Executes the tool with the specified JSON arguments.