neuron-explorer
Steering-first neuron explorer for Qwen3.5-4B: push every MLP neuron, keep every rollout, browse the results
翻译准备中
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证Zero-config GraphQL API for your existing database. One connection string, full API, no schema authoring.
翻译准备中
取自仓库 README
正在加载完整 README。 以下为已保存的摘录。
Zero-config GraphQL API for your existing database. One connection string. Full API.
That's a complete GraphQL API. Every table, every column, every relationship. Queries, mutations, filtering, pagination, joins -- all generated from your schema at startup.查看完整 README ↗Zero-config GraphQL API for your existing database. One connection string. Full API.
Documentation | GitHub | NuGet
// Program.cs - that's it
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddBifrostQL(o => o.BindStandardConfig(builder.Configuration));
var app = builder.Build();
app.UseBifrostQL();
await app.RunAsync();
// appsettings.json
{
"ConnectionStrings": {
"bifrost": "Server=localhost;Database=mydb;User Id=sa;Password=xxx"
},
"BifrostQL": { "Path": "/graphql", "Playground": "/graphiql" }
}
That's a complete GraphQL API. Every table, every column, every relationship. Queries, mutations, filtering, pagination, joins -- all generated from your schema at startup.
_eq, _contains, _gt, _in. Pagination via limit/offset. Sorting via enum fields.| Database | Status | Dialect |
|---|---|---|
| SQL Server | Production | BifrostQL.SqlServer |
| PostgreSQL | Production | BifrostQL.Ngsql |
| MySQL | Production | BifrostQL.MySql |
| SQLite | Experimental | BifrostQL.Sqlite |
Cross-cutting concerns handled via metadata configuration. No custom code required for common patterns.
Tenant Isolation -- Automatic WHERE clause injection per query, keyed to the authenticated user's tenant ID. Queries physically cannot return another tenant's data.
"dbo.orders { tenant-filter: tenant_id }"
Soft Delete -- DELETE mutations become UPDATE mutations that set a timestamp. SELECT queries automatically exclude soft-deleted rows and expose _includeDeleted for administrative reads.
"dbo.orders { soft-delete: deleted_at; soft-delete-by: deleted_by_user_id }"
Audit Columns -- created_by, updated_by, created_on, updated_on populated automatically from the authenticated user context.
"dbo.*.createdOn { populate: created-on; update: none; }"
"dbo.*.updatedOn { populate: updated-on; update: none; }"
Visibility Control -- Hide system tables, internal columns, or entire schemas from the API.
"dbo.sys*, *.__* { visibility: hidden; }"
All module configuration uses a CSS-like selector syntax with glob patterns. Apply rules to one table, a pattern of tables, or every table in a schema.
Automatic Claim Filters -- Map arbitrary user-context claims to table columns for row-level security beyond a single tenant ID.
"dbo.orders { auto-filter: organization_id:org_id,region_id:region }"
dotnet new web -n MyBifrostApi
cd MyBifrostApi
dotnet add package BifrostQL.Server
dotnet add package BifrostQL.SqlServer # or BifrostQL.Ngsql, BifrostQL.MySql
Add your connection string and BifrostQL settings to appsettings.json:
{
"ConnectionStrings": {
"bifrost": "Server=localhost;Database=mydb;User Id=sa;Password=xxx"
},
"BifrostQL": {
"Path": "/graphql",
"Playground": "/graphiql",
"DisableAuth": true,
"Provider": "sqlserver"
}
}
Replace your Program.cs:
using BifrostQL.Server;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddBifrostQL(o => o.BindStandardConfig(builder.Configuration));
builder.Services.AddCors();
var app = builder.Build();
app.UseCors(x => x.AllowAnyMethod().AllowAnyHeader().AllowAnyOrigin());
app.UseBifrostQL();
await app.RunAsync();
dotnet run
# GraphQL playground at http://localhost:5000/graphiql
# API endpoint at http://localhost:5000/graphql
BifrostQL includes a CLI tool for schema introspection, config generation, and local serving:
dotnet tool install -g BifrostQL.Tool
bifrost serve --connection "Server=localhost;Database=mydb;..."
bifrost schema --connection "..."
bifrost config-generate --connection "..."
# Get all users with pagination
{
users(limit: 10, offset: 0, sort: [name_asc]) {
data {
userId
name
email
}
}
}
# Filter with operators
{
orders(filter: { status: { _eq: "shipped" }, total: { _gt: 100 } }) {
data {
orderId
total
status
}
}
}
# Relationship fields - no config needed for matching keys
{
orders {
data {
orderId
customers {
name
}
}
}
}
# Insert mutation
mutation {
products(insert: { name: "Widget", price: 9.99 })
}
Most GraphQL servers hit the database once per field resolver. A query that fetches 50 orders with their customers triggers 1 query for orders + 50 queries for customers -- the classic N+1 problem. DataLoader batching reduces this but still requires careful implementation per relationship.
BifrostQL takes a different approach: one query per table, regardless of row count.
When BifrostQL receives a GraphQL request, it:
GqlObjectQuery structure before executing anythingSELECT ...; SELECT ...; SELECT ...)ExecuteReader call and assembles the response in memoryFor example, this query:
{
orders(limit: 50) {
data {
orderId
total
customers {
name
email
}
order_items {
productId
quantity
}
}
}
}
Generates exactly 3 SQL queries -- one for orders, one for customers, one for order_items -- sent as a single batch. Not 50. Not 101. Three.
| Approach | Queries for 50 orders + customers + items |
|---|---|
| Naive resolvers | 1 + 50 + 50 = 101 |
| DataLoader batching | 1 + 1 + 1 = 3 (but requires manual setup per relationship) |
| BifrostQL | 3 (automatic, zero configuration) |
This holds regardless of nesting depth. A four-level deep join across orders → customers → addresses → cities still produces exactly four queries in one round-trip.
BifrostQL supports OAuth2/OIDC via JWT bearer tokens. When enabled, user context drives tenant isolation and audit column population.
{
"JwtSettings": {
"Authority": "https://your-idp.com",
"Audience": "your-api"
},
"BifrostQL": {
"DisableAuth": false
}
}
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(o => builder.Configuration.Bind("JwtSettings", o));
builder.Services.AddBifrostQL(o => o.BindStandardConfig(builder.Configuration));
var app = builder.Build();
app.UseAuthentication();
app.UseBifrostQL();
await app.RunAsync();
BifrostQL supports HTTP/3 (QUIC) with automatic HTTP/2 and HTTP/1.1 fallback:
{
"BifrostQL": {
"Http3": { "Enabled": true, "HttpsPort": 5001 }
}
}
builder.UseBifrostHttp3();
| Setting | Description | Default |
|---|---|---|
ConnectionStrings:bifrost | Database connection string | Required |
BifrostQL:Path | GraphQL endpoint path | /graphql |
BifrostQL:Playground | GraphiQL playground path | /graphiql |
BifrostQL:DisableAuth | Disable authentication | false |
BifrostQL:Provider | Database provider (sqlserver, postgres, mysql, sqlite) | sqlserver |
BifrostQL:Metadata | Array of metadata configuration rules | [] |
Rules use CSS-like selectors to target tables and columns:
"schema.table { property: value; }" # Specific table
"schema.table.column { property: value; }" # Specific column
"schema.* { property: value; }" # All tables in schema
"schema.*|has(column) { property: value; }" # Tables with a specific column
| Property | Values | Description |
|---|---|---|
tenant-filter | column name | Enable tenant isolation on this column |
tenant-context-key | claim key | User-context key for tenant ID |
auto-filter | column:claim list | Inject filters from user-context claims |
auto-filter-bypass-role | role name | Role that bypasses auto filters |
soft-delete | column name | Soft-delete timestamp column |
soft-delete-by | column name | Column to record who deleted |
delete-type | soft | Mark table for soft-delete behavior |
populate | created-by, updated-by, created-on, updated-on, deleted-on, deleted-by | Auto-populate from user context |
update | none | Mark column as read-only for updates |
visibility | hidden | Hide from GraphQL schema |
label | column name | Display label column for the table |
auto-join | true/false | Enable automatic join inference |
default-limit | number | Default page size |
de-pluralize | true/false | De-pluralize table names in schema |
raw-sql | enabled/disabled | Expose guarded _rawQuery |
generic-table | enabled/disabled | Expose guarded _table query |
schema-prefix | / |
BifrostQL.sln
src/
BifrostQL.Core/ # Core library (net8.0, net9.0, net10.0)
BifrostQL.Server/ # ASP.NET Core middleware
BifrostQL.Host/ # Example host application
BifrostQL.Tool/ # CLI tool (dotnet tool)
BifrostQL.UI/ # Desktop app (Photino)
data/
BifrostQL.SqlServer/ # SQL Server dialect
BifrostQL.Ngsql/ # PostgreSQL dialect
BifrostQL.MySql/ # MySQL dialect
BifrostQL.Sqlite/ # SQLite dialect
tests/
BifrostQL.Core.Test/
BifrostQL.Server.Test/
docker build -t bifrostql .
docker run -e ConnectionStrings__bifrost="Server=host.docker.internal;..." -p 5000:80 bifrostql
MIT
enableddisabled| Prefix table names with schema names |
sp-include / sp-exclude | regex | Include or exclude stored procedures |