diff --git a/README.md b/README.md index 56bcbd9d..91d60e4c 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Moreover, client packages and containers are available via: - [Docker](https://hub.docker.com/r/trailbase/trailbase) - [JavaScript/Typescript client](https://www.npmjs.com/package/trailbase) - [Dart/Flutter client](https://pub.dev/packages/trailbase) -- [C#/.Net](https://github.com/trailbaseio/trailbase/tree/main/client/trailbase-dotnet) +- [C#/.Net](https://www.nuget.org/packages/TrailBase/) ## Running diff --git a/client/trailbase-dotnet/ClientTest.cs b/client/trailbase-dotnet/ClientTest.cs index a5a9c49d..164d2913 100644 --- a/client/trailbase-dotnet/ClientTest.cs +++ b/client/trailbase-dotnet/ClientTest.cs @@ -1,9 +1,10 @@ +using Xunit; using System.Diagnostics; namespace TrailBase; public static class Constants { - public const int Port = 4007; + public static int Port = 4010 + System.Environment.Version.Major; } class SimpleStrict { @@ -113,9 +114,16 @@ public class ClientTest : IClassFixture { var api = client.Records("simple_strict_table"); var now = DateTimeOffset.Now.ToUnixTimeSeconds(); + + // Dotnet runs tests for multiple target framework versions in parallel. + // Each test currently brings up its own server but pointing at the same + // underlying database file. We include the runtime version in the filter + // query to avoid a race between both tests. This feels a bit hacky. + // Ideally, we'd run the tests sequentially or with better isolation :/. + var suffix = $"{now} {System.Environment.Version}"; List messages = [ - $"C# client test 0: {now}", - $"C# client test 1: {now}", + $"C# client test 0: {suffix}", + $"C# client test 1: {suffix}", ]; List ids = []; @@ -136,7 +144,7 @@ public class ClientTest : IClassFixture { var recordsAsc = await api.List( null, ["+text_not_null"], - [$"text_not_null[like]=%{now}"] + [$"text_not_null[like]=%{suffix}"] )!; Assert.Equal(messages.Count, recordsAsc.Count); Assert.Equal(messages, recordsAsc.ConvertAll((e) => e.text_not_null)); @@ -144,7 +152,7 @@ public class ClientTest : IClassFixture { var recordsDesc = await api.List( null, ["-text_not_null"], - [$"text_not_null[like]=%{now}"] + [$"text_not_null[like]=%{suffix}"] )!; Assert.Equal(messages.Count, recordsDesc.Count); recordsDesc.Reverse(); @@ -179,7 +187,7 @@ public class ClientTest : IClassFixture { var records = await api.List( null, null, - [$"text_not_null[like]=%{now}"] + [$"text_not_null[like]=%{suffix}"] )!; Assert.Single(records); diff --git a/client/trailbase-dotnet/README.md b/client/trailbase-dotnet/README.md new file mode 100644 index 00000000..a5c761c2 --- /dev/null +++ b/client/trailbase-dotnet/README.md @@ -0,0 +1,8 @@ +# TrailBase client library for .NET and MAUI + +TrailBase is a [blazingly](https://trailbase.io/reference/benchmarks/) fast, +single-file, open-source application server with type-safe APIs, built-in +JS/ES6/TS Runtime, Auth, and Admin UI built on Rust+SQLite+V8. + +For more context, documentation, and an online demo, check out our website +[trailbase.io](https://trailbase.io). diff --git a/client/trailbase-dotnet/TrailBase.csproj b/client/trailbase-dotnet/TrailBase.csproj index 53c2b4d7..76498262 100644 --- a/client/trailbase-dotnet/TrailBase.csproj +++ b/client/trailbase-dotnet/TrailBase.csproj @@ -1,11 +1,26 @@ - net8.0 + TrailBase + 0.1.1 + TrailBase authors + ./README.md + OSL-3.0 + https://trailbase.io + https://github.com/trailbaseio/trailbase + + net8.0;net9.0 + + true enable enable + true + + + + runtime; build; native; contentfiles; analyzers; buildtransitive @@ -22,8 +37,4 @@ - - - - diff --git a/docs/src/content/docs/index.mdx b/docs/src/content/docs/index.mdx index b73f7938..9f3ec4b9 100644 --- a/docs/src/content/docs/index.mdx +++ b/docs/src/content/docs/index.mdx @@ -137,9 +137,9 @@ import { Duration100kInsertsChart } from "./reference/_benchmarks/benchmarks.tsx Flutter - + Dotnet - +