1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
`Udb.Client` is the .NET client for UDB. Use it from .NET services that need to
read/write through the broker or call UDB auth/authz with the right request
metadata.
```powershell
dotnet add package Udb.Client --version 0.3.1
```
Runtime: .NET 8
The companion CLI tool is `Udb.Cli`:
```powershell
dotnet tool install --global Udb.Cli --version 0.3.1
```
The tool exposes `udb` and resolves the version-matched UDB binary.
From your application repo:
```powershell
udb proto export
```
Then your app protos can import:
```proto
import "udb/core/common/v1/db.proto";
```
```csharp
using Udb.Client;
using Udb.Entity.V1;
using AuthzV1 = udb.core.Authz.Services.V1;
var meta = new UdbMetadata(
await using var udb = new UdbClient("http://localhost:50051", meta);
RecordSet rows = await udb.SelectAsync(new SelectRequest
{
});
await using var auth = new UdbAuthClient("http://localhost:50051", meta);
var (allowed, decision) = await auth.CanAsync(
```
Consumers do not need this. Use it only when editing this repository:
```powershell
dotnet build sdk\csharp\Udb.Client\Udb.Client.csproj
dotnet build sdk\csharp\Udb.Cli\Udb.Cli.csproj
```