Scry.Server
0.1.0-beta.13
dotnet add package Scry.Server --version 0.1.0-beta.13
NuGet\Install-Package Scry.Server -Version 0.1.0-beta.13
<PackageReference Include="Scry.Server" Version="0.1.0-beta.13" />
<PackageVersion Include="Scry.Server" Version="0.1.0-beta.13" />
<PackageReference Include="Scry.Server" />
paket add Scry.Server --version 0.1.0-beta.13
#r "nuget: Scry.Server, 0.1.0-beta.13"
#:package Scry.Server@0.1.0-beta.13
#addin nuget:?package=Scry.Server&version=0.1.0-beta.13&prerelease
#tool nuget:?package=Scry.Server&version=0.1.0-beta.13&prerelease
Scry.Server
Server-side execution for Scry. Validates an incoming query AST against the allow-list, rebinds it to the real EF Core entity types, applies row-level policies, executes against a DbContext, and returns projected rows.
<a id='snippet-serverRegistration'></a>
services
.AddScry<SampleContext>(_ =>
{
// Holiday is a [QueryablePoco]: it has no table, so the server supplies its rows. Every
// [QueryablePoco] type must be registered here or AddScry throws at startup.
_.AddPocoSource(_ => Holiday.Seed());
// Department.Handbook and Employee.Photo are [Attachment]s, and one exposed without a
// check is a startup failure. Registered here rather than by [AttachmentWith] because
// the model project references the annotations alone and has no server type to name.
_.AddAttachmentPolicy<Department, HandbookPolicy>();
_.AddAttachmentPolicy<Employee, PhotoPolicy>();
_.MaxPageSize = 200;
// A row policy whose decision is too slow to run per row in SQL, so it runs in C# and
// the server remembers what it answered. Revision is what tells it a row has changed
// and needs deciding again — see /docs/policies.md and the /permissions page.
_.AddCachedPolicy<Order, long, RegionAccessPolicy>(_ => _.Revision);
// Repeat a query while nothing has been written and the answer is a 304 rather than a
// re-execution. Optional, and off until a freshness source says how to tell — see
// /docs/caching.md.
_.UseDeltaFreshness<SampleContext>();
// What a cached response belongs to. This server has sources whose answers depend on
// who asked — the row policy above, and Department.Handbook's attachment check — and
// MapScry refuses to start without this. The sample has no sign-in, so the caller
// half is a constant; a real app returns its tenant or its principal, and a client
// signing in as someone else is then never handed the previous one's rows.
//
// The grants version is the other half, and is the part worth copying. A response
// varies by what the caller is allowed to see, and QueryFreshness only watches the
// database — so a grant changing outside it would move nothing, and a cache holding
// the old rows would go on answering with rows the caller has since lost.
_.CacheScope = _ => $"sample-{_.RequestServices.GetRequiredService<RegionGrants>().Version}";
// Live queries: the /live pages. Off until a server says how many it will hold open,
// which is also what maps the route — see /docs/live-queries.md.
_.MaxSubscriptions = 100;
// The interceptor above reports this server's own saves, at once and by entity. This
// watches the database's change marker for everything it cannot see: a bulk update,
// another node, a script run by hand.
_.UseDeltaChanges<SampleContext>();
// Commands: the /commands page and the /live pages' Reprice. Off until a server says
// how many it will have in flight, which is also what maps the routes — see
// /docs/commands.md.
_.UseSampleCommands();
// An AI agent's way in: the schema, queries and commands over MCP, at /mcp. Off
// until a server says what an agent may do — see /docs/mcp.md.
_.Mcp = ScryMcpAccess.ReadWrite;
});
<sup><a href='/samples/Sample.WebServer/Program.cs#L57-L115' title='Snippet source file'>snippet source</a> | <a href='#snippet-serverRegistration' title='Start of snippet'>anchor</a></sup>
AddPocoSource supplies the rows for a [QueryablePoco] type — see POCO sources.
<a id='snippet-mapScry'></a>
app.MapScry("/api/query");
<sup><a href='/samples/Sample.WebServer/Program.cs#L136-L138' title='Snippet source file'>snippet source</a> | <a href='#snippet-mapScry' title='Start of snippet'>anchor</a></sup>
Docs: Server · Row policies · Security model
| 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
- Microsoft.EntityFrameworkCore (>= 10.0.12)
- Scry.Annotations (>= 0.1.0-beta.13)
- Scry.Wire (>= 0.1.0-beta.13)
NuGet packages (10)
Showing the top 5 NuGet packages that depend on Scry.Server:
| Package | Downloads |
|---|---|
|
Scry.Server.Explorer
An opt-in, browser-Roslyn query explorer (GraphiQL-style) for the Scry server API: write LINQ with IntelliSense, inspect the wire request, and run it. |
|
|
Scry.Server.Delta
Answers a repeated Scry query with 304 Not Modified while nothing has been written, by reading the database's own change marker through Delta. |
|
|
Scry.Server.Redis
Carries Scry change notifications between server nodes over Redis pub/sub, so a write on one node re-asks the live queries held by the others. |
|
|
Scry.Server.MassTransit
Carries Scry commands over MassTransit: a command a client sends is published to the consumer that handles it, and its outcome comes back to the client when the consumer is done. |
|
|
Scry.Server.MessagePipe
Carries Scry change notifications between server nodes over MessagePipe's distributed pub/sub, so a write on one node re-asks the live queries held by the others. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-beta.13 | 0 | 10/7/2026 |
| 0.1.0-beta.12 | 94 | 10/1/2026 |
| 0.1.0-beta.11 | 84 | 9/30/2026 |
| 0.1.0-beta.10 | 96 | 9/24/2026 |
| 0.1.0-beta.9 | 77 | 9/8/2026 |
| 0.1.0-beta.7 | 77 | 9/4/2026 |
| 0.1.0-beta.6 | 75 | 9/4/2026 |
| 0.1.0-beta.5 | 79 | 8/30/2026 |
| 0.1.0-beta.4 | 80 | 8/15/2026 |
| 0.1.0-beta.3 | 81 | 8/2/2026 |
| 0.1.0-beta.2 | 80 | 7/31/2026 |
| 0.1.0-beta.1 | 70 | 7/26/2026 |