StringThing.FSharp 2.0.3

dotnet add package StringThing.FSharp --version 2.0.3
                    
NuGet\Install-Package StringThing.FSharp -Version 2.0.3
                    
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="StringThing.FSharp" Version="2.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="StringThing.FSharp" Version="2.0.3" />
                    
Directory.Packages.props
<PackageReference Include="StringThing.FSharp" />
                    
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 StringThing.FSharp --version 2.0.3
                    
#r "nuget: StringThing.FSharp, 2.0.3"
                    
#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 StringThing.FSharp@2.0.3
                    
#: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=StringThing.FSharp&version=2.0.3
                    
Install as a Cake Addin
#tool nuget:?package=StringThing.FSharp&version=2.0.3
                    
Install as a Cake Tool

StringThing.FSharp

Core abstractions for the StringThing.FSharp family. Provider-agnostic. Not intended for direct use — install a provider package such as StringThing.FSharp.Sqlite.

What's in here

  • SqlElement<'TParameter> — DU of Literal of string / Parameter of 'TParameter.
  • FragmentNode<'TParameter> — internal binary tree the providers build their statements into; Combine is O(1).
  • SqlExecution.walk — flattens the tree, invoking provider-supplied callbacks per literal and per parameter, with a provider-specific name formatter.
  • RowReader<'T> — opaque applicative reader over DbDataReader. Built with the row { let! ... and! ... return ... } CE.
  • Row module — column readers (Row.int64 "id", Row.stringOption "email", etc.) and the scalar shortcuts Row.scalar / Row.scalarOption.
  • OrdinalCache — internal ConcurrentDictionary keyed on (format string, row type), populated lazily per call site.

Row reader CE

open StringThing.FSharp

type User = { Id: int64; Name: string; Email: string option }

let userRow : RowReader<User> =
    row {
        let! id    = Row.int64 "id"
        and! name  = Row.string "name"
        and! email = Row.stringOption "email"
        return { Id = id; Name = name; Email = email }
    }

The CE uses F#'s built-in applicative syntax (let! / and! — also seen in async { }, task { }, option { }). Each column reader contributes its name to a list and its read action to a chain. The provider resolves the column names to ordinals once per call site (cached), then applies the materializer chain per row.

Forgetting a column produces an error on the return line at the unbound name — local to the block.

Column readers

Row.int, Row.int64, Row.bool, Row.float, Row.string, Row.stringOption, Row.intOption, Row.int64Option, Row.guid, Row.dateTime, Row.bytes.

Scalar readers

Row.scalar<'T> and Row.scalarOption<'T> read column 0 of the result directly. Use when the query returns a single scalar:

let count : int64 =
    connection.QueryStringSingle Row.scalar $"""
        SELECT COUNT(*) FROM users
        """

Built by Immersus Machina

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 (4)

Showing the top 4 NuGet packages that depend on StringThing.FSharp:

Package Downloads
StringThing.FSharp.MySql

Injection-safe interpolated SQL for MySQL via MySqlConnector, F# edition. Part of StringThing.FSharp.

StringThing.FSharp.SqlClient

Injection-safe interpolated SQL for SQL Server via Microsoft.Data.SqlClient, F# edition. Part of StringThing.FSharp.

StringThing.FSharp.Npgsql

Injection-safe interpolated SQL for PostgreSQL via Npgsql, F# edition. Part of StringThing.FSharp.

StringThing.FSharp.Sqlite

Injection-safe interpolated SQL for SQLite, F# edition. Computation-expression SQL builder + applicative row reader.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.3 161 6/16/2026