Weir is a thin HTTP gateway over MSSQL: a client calls an endpoint, Weir invokes a stored procedure or function and streams the result back as JSON. This guide gets a local instance running and serves your first endpoint.
- .NET 10 SDK (to build and run from source), or Docker (to run the container / compose stack).
- A reachable SQL Server instance with the stored procedures you want to expose.
From source:
dotnet run --project src/Weir.HostOr with Docker (Weir in a container; compose connects to a SQL Server you provide, it does not start one):
docker compose up --build
# Windows: double-click run-docker-compose.batThe compose file runs the two surfaces on ports of their own: the endpoint API on
http://localhost:8080 and the admin console on http://localhost:8081 (keep that one private);
dotnet run serves everything on one origin, http://localhost:5000.
Weir routes each endpoint to a named data connection. Configure at least one in appsettings.json
(or via environment variables - see Configuration):
{
"Weir": {
"ControlPlane": { "ConnectionString": "Data Source=weir-control.db" },
"DataConnections": {
"default": {
"Provider": "SqlServer",
"ConnectionString": "Server=localhost;Database=Demo;Trusted_Connection=True;TrustServerCertificate=True"
}
},
"Admin": { "Username": "admin", "Password": "set-a-strong-password" },
"Jwt": { "SigningKey": "set-a-stable-secret" }
}
}ControlPlaneholds Weir's own metadata (endpoints, keys, scopes, admins, audit) in SQLite.DataConnectionsare the target databases. One instance can serve many.Adminbootstraps the first admin account on startup (only if no admin exists yet).
Open the host URL in a browser. You are redirected to the login page; sign in with the bootstrap admin credentials. You land on the dashboard with live metrics.
Go to Endpoints -> New endpoint and fill in:
- Route:
customers/get - HTTP method:
POST - Connection:
default - Object type:
StoredProcedure - Schema / Object name:
dbo/usp_GetCustomer - Parameters: add
customerIdwith sourceBody, typeInt32
Save. The catalog reloads immediately - no redeploy.
Create an API key under API keys (copy the plaintext once), then call the endpoint:
POST /api/customers/get
X-Api-Key: wk_live_9f3a...
Content-Type: application/json
{ "customerId": 42 }The response is the standard envelope:
{
"data": [ [ { "id": 42, "name": "Acme" } ] ],
"output": null,
"returnValue": 0,
"rowsAffected": -1,
"truncated": false,
"messages": []
}- Endpoints and API contract - parameters, TVP, output parameters, caching
- Security - API keys, scopes, admin accounts
- Configuration - every setting
- Deployment - Docker and compose
- Samples - a ready-to-import "widgets" schema (SQL Server and PostgreSQL), a
fuller demo database, and a CLI client / load tester (
weir-sample) that calls the endpoints over HTTP