neuron-explorer
Qwen3.5‑4B 전용 조향형 뉴런 탐색기, 모든 MLP 뉴런을 밀어 결과를 보관·탐색
Discord 봇용 제공자·라이브러리 무관 지속성 레이어, EF Core 10 기반
A provider-agnostic, Discord-library-agnostic persistence layer for Discord bots, built on EF Core 10. Ships the model only — entities, conventions, and module configurations. You stay in control of t
개발 도구C# · ShellGitHub @HandyS11온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기A provider-agnostic, Discord-library-agnostic persistence layer for Discord bots, built on EF Core 10. Ships the model only — entities, conventions, and module configurations. You stay in control of the database provider and the Discord gateway.
저장소 README에서 가져옴
README 전체를 불러오는 중입니다. 아래는 저장된 발췌입니다.
A provider-agnostic, Discord-library-agnostic persistence layer for Discord bots, built on EF Core 10.
Ships the model only — entities, conventions, and module configurations. You stay in control of the
database provider and the Discord gateway.
Discord ids are 64-bit ulong snowflakes; relational providers store signed long.
Persistord handles the bit-faithful ulong ↔ long round-trip globally, models the
core Discord graph (guilds, channels, users, members, roles, messages), and adds
opt-in soft-delete and append-only history — without coupling you to a specific
database or Discord library.README 전문 보기 ↗A provider-agnostic, Discord-library-agnostic persistence layer for Discord bots, built on EF Core 10. Ships the model only — entities, conventions, and module configurations. You stay in control of the database provider and the Discord gateway.
Getting Started · Documentation · Samples
Discord ids are 64-bit ulong snowflakes; relational providers store signed long.
Persistord handles the bit-faithful ulong ↔ long round-trip globally, models the
core Discord graph (guilds, channels, users, members, roles, messages), and adds
opt-in soft-delete and append-only history — without coupling you to a specific
database or Discord library.
| Package | Downloads | Adds | Depends on |
|---|---|---|---|
Persistord | meta package — bundles Core, Messages, and History | Core, Messages, History | |
Persistord.Core | snowflake conversion, base DiscordDbContext, opt-in skeleton graph (DiscordGraphDbContext), guild root, upsert, purge | — | |
Persistord.Messages | MessageEntity (soft-delete), embeds, attachments, reactions | Core | |
Persistord.History | append-only MessageHistoryEntity with a real FK to messages | Messages | |
Persistord.Adapters.DiscordNet | .To*Entity() mappers from Discord.Net types | Core, Messages, History |
The core packages are independent of any Discord client library. Install an adapter only if you use that library — Persistord.Adapters.DiscordNet for Discord.Net, Persistord.Adapters.DSharpPlus for DSharpPlus, Persistord.Adapters.NetCord for NetCord.
Persistord.Managed, Persistord.Protection, and Persistord.Testing are opt-in and
not part of the Persistord meta package: a bot that only mirrors Discord never
owns resources, encrypts a column, or needs the test fixtures, so the meta package
stays the library-neutral mirror stack (Core, Messages, History) and nothing more.
# Recommended: the full library-neutral stack in one package
dotnet add package Persistord
# Or install modules individually:
dotnet add package Persistord.Core
dotnet add package Persistord.Messages # optional: message persistence
dotnet add package Persistord.History # optional: requires Messages
dotnet add package Persistord.Adapters.DiscordNet # optional: Discord.Net mappers
dotnet add package Persistord.Adapters.DSharpPlus # optional: DSharpPlus mappers
dotnet add package Persistord.Adapters.NetCord # optional: NetCord mappers
DiscordDbContext applies only the snowflake conventions and maps nothing —
derive it and apply the module configurations you want in OnModelCreating:
using Microsoft.EntityFrameworkCore;
using Persistord.Core;
using Persistord.History;
using Persistord.History.Entities;
using Persistord.Messages;
using Persistord.Messages.Entities;
public sealed class MyBotContext : DiscordDbContext
{
public MyBotContext(DbContextOptions<MyBotContext> options) : base(options) { }
public DbSet<MessageEntity> Messages => Set<MessageEntity>();
public DbSet<MessageHistoryEntity> MessageHistory => Set<MessageHistoryEntity>();
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder); // snowflake convention only
modelBuilder.ApplyMessagesModule(); // omit if you don't persist messages
modelBuilder.ApplyHistoryModule(); // requires ApplyMessagesModule()
}
}
If your bot also mirrors guilds, channels, users, members or roles, derive
DiscordGraphDbContext instead — it exposes those DbSets (Guilds,
Channels, Users, Members, Roles) automatically, on top of the same
conventions.
The consumer owns the provider choice. Any EF Core 10 relational provider works (PostgreSQL, SQL Server, SQLite, …); the snowflake conversion is applied automatically.
services.AddDbContextFactory<MyBotContext>(options =>
options.UseNpgsql(builder.Configuration.GetConnectionString("Bot")));
A bot is long-lived and concurrent; a DbContext is neither thread-safe nor meant
to live forever. Create one per unit of work via the factory and dispose it:
await using var db = await factory.CreateDbContextAsync();
db.Messages.Add(new MessageEntity
{
Id = message.Id,
ChannelId = message.ChannelId,
AuthorId = message.Author.Id,
Content = message.Content,
});
await db.SaveChangesAsync();
If you use Discord.Net, the adapter maps gateway/REST types for you:
using Persistord.Adapters.DiscordNet;
using Persistord.History.Entities;
db.Messages.Add(socketMessage.ToMessageEntity()); // embeds, attachments, reactions included
db.MessageHistory.Add(socketMessage.ToHistoryEntity(HistoryChangeType.Created));
await db.SaveChangesAsync();
Deleting a message sets IsDeleted / DeletedAt rather than removing the row, and a
default query filter hides soft-deleted messages (IgnoreQueryFilters() to include
them, or ApplyMessagesModule(filterDeleted: false) to disable). Because the row
survives, MessageHistoryEntity's foreign key to it — including the row logging the
deletion — stays valid.
Full guides and the API reference live on the documentation site (built with DocFX). Start with Getting Started, browse the Guides and Recipes, or check Troubleshooting if something isn't working.
samples/.dotnet restore
dotnet build
dotnet test
Requires the .NET 10 SDK. Formatting is enforced with ReSharper
(dotnet jb cleanupcode Persistord.slnx --profile="ReformatAndReorder").
MIT © Clergue Valentin
Persistord.Adapters.DSharpPlus | .To*Entity() mappers from DSharpPlus types | Core, Messages, History |
Persistord.Adapters.NetCord | .To*Entity() mappers from NetCord types | Core, Messages, History |
Persistord.Managed | records of the categories, channels, anchored messages, and webhooks a bot creates and owns | Core |
Persistord.Protection | encrypts [Protected] string columns at rest via ASP.NET Core Data Protection | Core |
Persistord.Testing | in-memory SQLite fixtures and EF Core model assertions for tests | Core |