DotPrompt.Sql 0.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package DotPrompt.Sql --version 0.3.0
                    
NuGet\Install-Package DotPrompt.Sql -Version 0.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DotPrompt.Sql" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DotPrompt.Sql" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="DotPrompt.Sql" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DotPrompt.Sql --version 0.3.0
                    
#r "nuget: DotPrompt.Sql, 0.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DotPrompt.Sql@0.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DotPrompt.Sql&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=DotPrompt.Sql&version=0.3.0
                    
Install as a Cake Tool

DotPrompt.Sql

A SQL store for the DotPrompt library. It stores prompt files in a set of related SQL Server tables, with automatic versioning — a new version is only inserted when the content of a prompt actually changes.

A CLI is provided to add prompt files directly to the database.

Requirements

  • .NET 10
  • SQL Server, Azure SQL DB, or Microsoft Fabric SQL DB

Installation

dotnet add package DotPrompt.Sql

CLI Usage

DotPrompt.Sql.Cli ./prompts/basic.prompt ./sample.yaml

The YAML file should contain the connection details for SQL Server, Azure SQL DB, or Microsoft Fabric SQL DB:

server: "myserver.database.windows.net"
database: "mydatabase"
tablename: "mytable"
username: "myuser"
password: "mypassword"
integrated_authentication: false
aad_authentication: true

Supported Features

DotPrompt.Sql supports all current DotPrompt prompt file features:

Feature Supported
Name
Version
Model
System prompt
User prompt
Temperature
MaxTokens
Parameters
Default values
Output format
Output schema (JSON Schema)
Few-shot examples

Using the Store in Code

Instantiate SqlTablePromptStore with an IPromptRepository backed by an open IDbConnection:

IDbConnection connection = new SqlConnection(connectionString);
IPromptRepository repository = new SqlPromptRepository(connection);
IPromptStore store = new SqlTablePromptStore(repository);

// Load all latest-version prompts
IEnumerable<PromptFile> prompts = store.Load();

// Save a prompt file
store.Save(myPromptFile, name: null);

Database Schema

Tables are created automatically on first run via CreateDefaultPromptTables.sql. The schema uses:

  • PromptFile — one row per prompt version, with a unique constraint on (PromptName, VersionNumber)
  • PromptParameters — parameter name/type pairs linked to a prompt version
  • ParameterDefaults — default values linked to parameters

New columns added in v0.2.3:

Column Type Purpose
Temperature FLOAT NULL Maps to PromptConfig.Temperature
OutputSchema NVARCHAR(MAX) NULL JSON Schema document for structured output
FewShots NVARCHAR(MAX) NULL JSON array of few-shot user/response pairs

Existing databases are migrated automatically — the SQL scripts use IF NOT EXISTS guards to add missing columns without data loss.

Architecture

Open Source Diagrams.png

You can review the DotPrompt library here.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.1 39 4/6/2026
0.3.0 38 4/6/2026
0.2.2 235 8/25/2025
0.2.1 238 2/2/2025
0.1.2 181 1/26/2025
0.1.1 183 1/26/2025