Code generation



A configured database command generates a typed DbCommand method and result metadata.
static readonly CachedTypeParser<List<GetAlbumsByArtistResult>> AlbumParser = new();
List<GetAlbumsByArtistResult> albums = AlbumParser.Query(cnn.GetAlbumsByArtist(artistId: 7));
The generated method returns a DbCommand.
using DbCommand command = cnn.GetAlbumsByArtist(artistId: 7);
using DbDataReader reader = command.ExecuteReader();
Configure · Add queries · Generated commands · Refresh
SQL file command
{
"MethodName": "GetAlbums",
"SQLFile": "Sql/GetAlbums.sql"
}
using DbCommand command = cnn.GetAlbums();
The generated command reads the current SQL through RinkuPowerTools.GetSqlFile.
SQL file generation and runtime replacement
Analyzers
/// <Schema LastUpdated="2026-08-21T14:00Z" />
public partial record GetAlbumResult(int Id, string Title);
/// <BasedOn cref="GetAlbumResult" LastUpdated="2026-08-21T14:00Z" />
public record AlbumDto(int Id, string Title);
The analyzers ship in the Rinku package. Power Tools is not required for them.