CloudTheWolf.DSharpPlus.Scaffolding.Data
3.4.0.1
dotnet add package CloudTheWolf.DSharpPlus.Scaffolding.Data --version 3.4.0.1
NuGet\Install-Package CloudTheWolf.DSharpPlus.Scaffolding.Data -Version 3.4.0.1
<PackageReference Include="CloudTheWolf.DSharpPlus.Scaffolding.Data" Version="3.4.0.1" />
<PackageVersion Include="CloudTheWolf.DSharpPlus.Scaffolding.Data" Version="3.4.0.1" />
<PackageReference Include="CloudTheWolf.DSharpPlus.Scaffolding.Data" />
paket add CloudTheWolf.DSharpPlus.Scaffolding.Data --version 3.4.0.1
#r "nuget: CloudTheWolf.DSharpPlus.Scaffolding.Data, 3.4.0.1"
#:package CloudTheWolf.DSharpPlus.Scaffolding.Data@3.4.0.1
#addin nuget:?package=CloudTheWolf.DSharpPlus.Scaffolding.Data&version=3.4.0.1
#tool nuget:?package=CloudTheWolf.DSharpPlus.Scaffolding.Data&version=3.4.0.1
CloudTheWolf.DSharpPlus.Scaffolding.Data
Database providers for CloudTheWolf DSharpPlus workers and plugins.
Supported SQL providers are MySQL, SQL Server, PostgreSQL, SQLite, SurrealDB,
and Supabase PostgreSQL. Firebase Cloud Firestore is exposed separately through
the document-oriented IDocumentDatabase API.
SQL databases
Existing synchronous calls remain supported. New code can use typed, cancellation-aware asynchronous methods:
IDatabase database = DatabaseFactory.CreateDatabase(configuration);
IEnumerable<User> users = await database.QueryAsync<User>(
"select id, name from users where active = @active",
new { active = true },
cancellationToken);
Set Database:type to mysql, sqlsrv, pgsql, sqlite, surreal, or
supabase.
MySQL
{
"Database": {
"type": "mysql",
"mysql": {
"server": "localhost",
"port": 3306,
"userid": "bot_user",
"password": "use-a-secret-provider",
"database": "discord_bot"
}
}
}
IDatabase database = DatabaseFactory.CreateDatabase(configuration);
IEnumerable<GuildSettings> settings = await database.QueryAsync<GuildSettings>(
"SELECT guild_id AS GuildId, prefix AS Prefix FROM guild_settings WHERE guild_id = @guildId",
new { guildId },
cancellationToken);
Microsoft SQL Server
{
"Database": {
"type": "sqlsrv",
"sqlsrv": {
"server": "localhost",
"port": 1433,
"userid": "bot_user",
"password": "use-a-secret-provider",
"database": "DiscordBot"
}
}
}
IDatabase database = DatabaseFactory.CreateDatabase(configuration);
int affected = await database.ExecuteAsync(
"UPDATE guild_settings SET prefix = @prefix WHERE guild_id = @guildId",
new { prefix = "!", guildId },
cancellationToken);
PostgreSQL
{
"Database": {
"type": "pgsql",
"pgsql": {
"server": "localhost",
"port": 5432,
"userid": "bot_user",
"password": "use-a-secret-provider",
"database": "discord_bot"
}
}
}
IDatabase database = DatabaseFactory.CreateDatabase(configuration);
IEnumerable<GuildSettings> settings = await database.QueryAsync<GuildSettings>(
"SELECT guild_id AS GuildId, prefix AS Prefix FROM guild_settings WHERE guild_id = @guildId",
new { guildId },
cancellationToken);
SQLite
{
"Database": {
"type": "sqlite",
"sqlite": {
"datasource": "data/discord-bot.db",
"mode": "ReadWriteCreate",
"password": ""
}
}
}
IDatabase database = DatabaseFactory.CreateDatabase(configuration);
await database.ExecuteAsync(
"CREATE TABLE IF NOT EXISTS guild_settings (guild_id TEXT PRIMARY KEY, prefix TEXT NOT NULL)",
cancellationToken: cancellationToken);
SurrealDB
{
"Database": {
"type": "surreal",
"surreal": {
"server": "http://127.0.0.1:8000",
"userid": "root",
"password": "use-a-secret-provider",
"namespace": "discord",
"database": "bot"
}
}
}
SurrealDB accepts SurrealQL and named parameters:
IDatabase database = DatabaseFactory.CreateDatabase(configuration);
IEnumerable<GuildSettings> settings = await database.QueryAsync<GuildSettings>(
"SELECT * FROM guild_settings WHERE guild_id = $guildId",
new { guildId },
cancellationToken);
await database.ExecuteAsync(
"UPSERT guild_settings SET guild_id = $guildId, prefix = $prefix WHERE guild_id = $guildId",
new { guildId, prefix = "!" },
cancellationToken);
Supabase
Copy a direct or session-pooler PostgreSQL connection string from the Supabase dashboard:
{
"Database": {
"type": "supabase",
"supabase": {
"connectionString": "Host=db.PROJECT.supabase.co;Port=5432;Username=postgres;Password=...;Database=postgres;SSL Mode=Require"
}
}
}
ConnectionStrings:Supabase is also supported. Keep connection strings in user
secrets, environment-specific configuration, or another secret store rather
than source control.
Supabase uses the same typed SQL methods as PostgreSQL:
IDatabase database = DatabaseFactory.CreateDatabase(configuration);
IEnumerable<GuildSettings> settings = await database.QueryAsync<GuildSettings>(
"SELECT guild_id AS GuildId, prefix AS Prefix FROM guild_settings WHERE guild_id = @guildId",
new { guildId },
cancellationToken);
Firebase Cloud Firestore
Firestore models use the attributes provided by Google.Cloud.Firestore:
[FirestoreData]
public sealed class GuildSettings
{
[FirestoreProperty]
public string Prefix { get; set; }
}
Create and use the document provider as follows:
IDocumentDatabase database = DatabaseFactory.CreateDocumentDatabase(configuration);
await database.SetAsync("guild-settings", guildId, settings, merge: true,
cancellationToken);
DatabaseDocument<GuildSettings> stored = await database.GetAsync<GuildSettings>(
"guild-settings", guildId, cancellationToken);
IReadOnlyList<DatabaseDocument<GuildSettings>> allSettings =
await database.GetCollectionAsync<GuildSettings>("guild-settings", cancellationToken);
string newDocumentId = await database.AddAsync(
"guild-settings", new GuildSettings { Prefix = "?" }, cancellationToken);
await database.DeleteAsync("guild-settings", newDocumentId, cancellationToken);
Configuration:
{
"Database": {
"type": "firestore",
"firebase": {
"projectId": "my-firebase-project",
"databaseId": "",
"detectEmulator": false
}
}
}
Firestore uses Google Application Default Credentials. In local or self-hosted
environments, set GOOGLE_APPLICATION_CREDENTIALS to a trusted service-account
credential file. On Google Cloud, use the workload's attached service account.
Set detectEmulator to true when the same build should honor
FIRESTORE_EMULATOR_HOST.
| Product | Versions 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. |
-
net10.0
- CloudTheWolf.DSharpPlus.Scaffolding.Logging (>= 3.2.0.5)
- Dapper (>= 2.1.79)
- Google.Cloud.Firestore (>= 4.3.0)
- Microsoft.Data.SqlClient (>= 7.0.2)
- Microsoft.Data.Sqlite (>= 10.0.10)
- MySql.Data (>= 26.7.0)
- Newtonsoft.Json (>= 13.0.4)
- Npgsql (>= 10.0.3)
- SQLitePCLRaw.lib.e_sqlite3 (>= 2.1.12)
- SurrealDB.Models (>= 1.0.8)
- SurrealDb.Net (>= 1.0.0)
- SurrealDb.Reactive (>= 1.0.0)
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 |
|---|---|---|
| 3.4.0.1 | 123 | 8/9/2026 |
| 3.1.0 | 428 | 11/30/2025 |
| 3.0.1.6 | 318 | 11/12/2025 |
| 3.0.1.4 | 244 | 6/26/2025 |
| 3.0.1.2 | 273 | 6/1/2025 |
| 3.0.1.1 | 236 | 2/9/2025 |
| 3.0.0.8 | 244 | 8/3/2024 |
| 3.0.0.7 | 167 | 8/3/2024 |
| 3.0.0.6 | 158 | 8/3/2024 |
| 3.0.0.4 | 166 | 7/31/2024 |
| 3.0.0.3 | 200 | 7/31/2024 |
| 3.0.0.2 | 158 | 7/31/2024 |
| 3.0.0.1 | 175 | 7/30/2024 |
| 3.0.0 | 209 | 7/28/2024 |
| 2.1.0.3 | 305 | 4/12/2024 |
| 2.1.0.2 | 278 | 2/4/2024 |
| 2.1.0.1 | 320 | 12/10/2023 |
| 2.1.0 | 295 | 12/5/2023 |
| 2.0.0.1 | 749 | 4/15/2022 |
| 1.0.1.9 | 529 | 11/1/2021 |