Delly.DBunny.Core 2026.5.7

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

Delly.DBunny.Core

License .NET AOT Compatible

The core library for DBunny, providing interfaces and base types for database abstraction.

Installation

dotnet add package Delly.DBunny.Core

Core Types

IDbProvider

The main database provider interface for managing database connections and commands.

public interface IDbProvider
{
    string DatabaseType { get; }
    ISqlProvider SqlProvider { get; }

    DbConnection GetDbConnection(string connectionString);
    DbCommand GetDbCommand(DbConnection connection);
    void SetParameters(DbCommand command, IEnumerable<KeyValuePair<string, object>> parameters);
    DataSet GetDataSet(DbCommand command);

    Task<IReadOnlyList<string>> GetSchemas(DbConnection connection);
    Task<IReadOnlyList<DbTableDesciptor>> GetTables(DbConnection connection, string schema);
    Task<IReadOnlyList<DbColumnDesciptor>> GetColumns(DbConnection connection, string schema, string table);
    Task<IReadOnlyList<DbIndexDesciptor>> GetIndexes(DbConnection connection, string schema, string table);
}

ISqlProvider

Interface for generating database-specific SQL statements.

public interface ISqlProvider
{
    string GetSpecialName(string name);
    string GetSpecialTypeName(TypeCode typeCode, int length = 0, int precision = 0);
    string GetSpecialTypeName(DbColumnType columnType, int length = 0, int precision = 0);

    bool HasDatabase { get; }
    bool HasSchema { get; }

    Sqled GetDatabases();
    Sqled CreateDatabase(string database, IDictionary<string, object> options);
    Sqled DropDatabase(string database);

    Sqled GetSchemas();
    Sqled CreateSchema(string schema, IDictionary<string, object> options);
    Sqled DropSchema(string schema);

    Sqled GetTables(string schema);
    Sqled CreateTable(string schema, string table, IList<DbColumnDesciptor> columnDesciptors);
    Sqled DropTable(string schema, string table);

    Sqled GetColumns(string schema, string table);
    Sqled CreateColumn(DbColumnDesciptor columnDesciptor);
    Sqled RenameColumn(string schema, string table, string column, string columnTarget);
    Sqled ModifyColumn(DbColumnDesciptor column, DbColumnDesciptor columnTarget);
    Sqled CopyColumn(string schema, string table, string column, string columnTarget, string columnType);
    Sqled DropColumn(string schema, string table, string column);

    Sqled GetIndexes(string schema, string table);
    Sqled CreateIndex(DbIndexDesciptor indexDesciptor);
    Sqled DropIndex(string schema, string table, string column);
}

Sqled

A wrapper class for SQL commands that combines SQL text with parameters.

var sql = new Sqled("SELECT * FROM Users WHERE Name = @name")
    .Set("name", "John");

// Fluent API
sql.Append(" AND Age > @minAge")
    .Set("minAge", 18);

// Access properties
string query = sql.Sql;
Dictionary<string, object> params = sql.Parameters;

// For complex SQL, use Builder directly
var createTableSql = new Sqled();
createTableSql.Builder.AppendLine("CREATE TABLE [Users](");
createTableSql.Builder.Append("    [Id] INTEGER NOT NULL PRIMARY KEY,");
createTableSql.Builder.Append("    [Name] TEXT(100) NOT NULL,");
createTableSql.Builder.AppendLine("    [Age] INTEGER NULL");
createTableSql.Builder.AppendLine(");");

Descriptors

DbConnectionDescriptor

Describes a database connection.

public class DbConnectionDescriptor
{
    public string Name { get; set; }
    public string DatabaseType { get; set; }
    public string ConnectionString { get; set; }
}
DbTableDesciptor

Describes a database table.

public class DbTableDesciptor
{
    public string SchemaName { get; set; }
    public string TableName { get; set; }
}
DbColumnDesciptor

Describes a database table column.

public class DbColumnDesciptor : DbTableDesciptor
{
    public string ColumnName { get; set; }
    public string ColumnType { get; set; }
    public bool PrimaryKeyFlag { get; set; }
    public bool NullableFlag { get; set; }
}
DbIndexDesciptor

Describes a database index.

public class DbIndexDesciptor : DbTableDesciptor
{
    public string IndexName { get; set; }
    public bool UniqueFlag { get; set; }
    public string ColumnName { get; set; }
}

DbColumnType

Enum for database column types.

public enum DbColumnType
{
    UNKNOW,
    DECIMAL,
    TINY,
    INTEGER,
    LONG,
    TIME,
    VARCHAR,
    TEXT
}

Base Classes

BaseConnectionDefine

Abstract base class for connection definitions:

public abstract class BaseConnectionDefine : IDbConnectionDefine
{
    protected void Set(string key, object value);
    protected T Get<T>(string key, T defaultValue);
    protected bool ContainsKey(string key);
    protected IDictionary<string, object> GetProperties();
    public string GetConnectionString();
}

Extensions

SqledExtension

Fluent methods for building SQL:

public static class SqledExtension
{
    public static Sqled Append(this Sqled sqled, string sql);
    public static Sqled Set(this Sqled sqled, string key, object value);
}
DbProviderExtension

Helper methods for executing queries:

public static class DbProviderExtension
{
    public static async Task ReadAsync(this IDbProvider provider, DbConnection connection, Sqled sqled, Func<DbDataReader, Task> readAction);
    public static void Read(this IDbProvider provider, DbConnection connection, Sqled sqled, Action<DbDataReader> readAction);
}
DbConnectionDefineExtension

Extension methods for connection define:

public static class DbConnectionDefineExtension
{
    public static DbConnectionDescriptor GetDbConnectionDescriptor(this IDbConnectionDefine connectionDefine, string databaseType, string name);
}

License

MIT License

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.
  • net5.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (7)

Showing the top 5 NuGet packages that depend on Delly.DBunny.Core:

Package Downloads
Delly.DBunny.Sqlite

SQLite provider for Delly.DBunny

Delly.DBunny.MySql

MySQL provider for Delly.DBunny

Delly.DBunny.PostgreSql

PostgreSQL provider for Delly.DBunny

Delly.DBunny.Oracle

Oracle provider for Delly.DBunny

Delly.DBunny

A lightweight .NET database abstraction layer that provides a unified API for working with multiple database types. DBunny uses a provider pattern to enable database-specific implementations while maintaining a common interface.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2026.5.7 365 5/19/2026
2026.5.6 365 5/19/2026
2026.5.5 388 5/18/2026
2026.5.4 397 5/18/2026
2026.5.3 335 5/18/2026
2026.5.2 261 5/17/2026