Bump version to 3

- Add description to each project
- Add .sh files to test and package
This commit is contained in:
Daniel J. Summers 2024-04-20 22:58:41 -04:00
parent aa14333604
commit fc045d021c
9 changed files with 82 additions and 26 deletions

View File

@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<PackageReleaseNotes>Added Field type for by-field operations</PackageReleaseNotes> <Description>Common files for PostgreSQL and SQLite document database libraries</Description>
<PackageReleaseNotes>v3 release</PackageReleaseNotes>
<PackageTags>JSON Document SQL</PackageTags> <PackageTags>JSON Document SQL</PackageTags>
</PropertyGroup> </PropertyGroup>

View File

@ -6,14 +6,13 @@
<AssemblyVersion>3.0.0.0</AssemblyVersion> <AssemblyVersion>3.0.0.0</AssemblyVersion>
<FileVersion>3.0.0.0</FileVersion> <FileVersion>3.0.0.0</FileVersion>
<VersionPrefix>3.0.0</VersionPrefix> <VersionPrefix>3.0.0</VersionPrefix>
<VersionSuffix>rc-2</VersionSuffix>
<Authors>danieljsummers</Authors> <Authors>danieljsummers</Authors>
<Company>Bit Badger Solutions</Company> <Company>Bit Badger Solutions</Company>
<PackageReadmeFile>README.md</PackageReadmeFile> <PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>icon.png</PackageIcon> <PackageIcon>icon.png</PackageIcon>
<PackageProjectUrl>https://bitbadger.solutions/open-source/relational-documents/</PackageProjectUrl> <PackageProjectUrl>https://bitbadger.solutions/open-source/relational-documents/</PackageProjectUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance> <PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<RepositoryUrl>https://github.com/bit-badger/BitBadger.Documents</RepositoryUrl> <RepositoryUrl>https://git.bitbadger.solutions/bit-badger/BitBadger.Documents</RepositoryUrl>
<RepositoryType>Git</RepositoryType> <RepositoryType>Git</RepositoryType>
<Copyright>MIT License</Copyright> <Copyright>MIT License</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression> <PackageLicenseExpression>MIT</PackageLicenseExpression>

View File

@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<PackageReleaseNotes>Adds Field type for by-field operations (BREAKING from rc-1); adds RemoveFields* functions</PackageReleaseNotes> <Description>Use PostgreSQL as a document database</Description>
<PackageReleaseNotes>v3 release; official replacement for BitBadger.Npgsql.Documents</PackageReleaseNotes>
<PackageTags>JSON Document PostgreSQL Npgsql</PackageTags> <PackageTags>JSON Document PostgreSQL Npgsql</PackageTags>
</PropertyGroup> </PropertyGroup>

View File

@ -45,7 +45,7 @@ Retrieve all customers:
```csharp ```csharp
// C#; parameter is table name // C#; parameter is table name
// Find.All type signature is Func<string, Task<List<TDoc>>> // Find.All type signature is Func<string, Task<List<TDoc>>>
var customers = await Find.All("customer"); var customers = await Find.All<Customer>("customer");
``` ```
```fsharp ```fsharp

View File

@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<PackageReleaseNotes>Adds Field type for by-field operations (BREAKING from rc-1); adds RemoveFields* functions</PackageReleaseNotes> <Description>Use SQLite as a document database</Description>
<PackageReleaseNotes>Overall v3 release; initial release supporting SQLite</PackageReleaseNotes>
<PackageTags>JSON Document SQLite</PackageTags> <PackageTags>JSON Document SQLite</PackageTags>
</PropertyGroup> </PropertyGroup>

View File

@ -45,7 +45,7 @@ Retrieve all customers:
```csharp ```csharp
// C#; parameter is table name // C#; parameter is table name
// Find.All type signature is Func<string, Task<List<TDoc>>> // Find.All type signature is Func<string, Task<List<TDoc>>>
var customers = await Find.All("customer"); var customers = await Find.All<Customer>("customer");
``` ```
```fsharp ```fsharp
@ -72,28 +72,28 @@ Count customers in Atlanta:
```csharp ```csharp
// C#; parameters are table name, field, operator, and value // C#; parameters are table name, field, operator, and value
// Count.ByField type signature is Func<string, string, Op, object, Task<long>> // Count.ByField type signature is Func<string, Field, Task<long>>
var customerCount = await Count.ByField("customer", "City", Op.EQ, "Atlanta"); var customerCount = await Count.ByField("customer", Field.EQ("City", "Atlanta"));
``` ```
```fsharp ```fsharp
// F# // F#
// Count.byField type signature is string -> string -> Op -> obj -> Task<int64> // Count.byField type signature is string -> Field -> Task<int64>
let! customerCount = Count.byField "customer" "City" EQ "Atlanta" let! customerCount = Count.byField "customer" (Field.EQ "City" "Atlanta")
``` ```
Delete customers in Chicago: _(no offense, Second City; just an example...)_ Delete customers in Chicago: _(no offense, Second City; just an example...)_
```csharp ```csharp
// C#; parameters are same as above, except return is void // C#; parameters are same as above, except return is void
// Delete.ByField type signature is Func<string, string, Op, object, Task> // Delete.ByField type signature is Func<string, Field, Task>
await Delete.ByField("customer", "City", Op.EQ, "Chicago"); await Delete.ByField("customer", Field.EQ("City", "Chicago"));
``` ```
```fsharp ```fsharp
// F# // F#
// Delete.byField type signature is string -> string -> Op -> obj -> Task<unit> // Delete.byField type signature is string -> string -> Op -> obj -> Task<unit>
do! Delete.byField "customer" "City" EQ "Chicago" do! Delete.byField "customer" (Field.EQ "City" "Chicago")
``` ```
## More Information ## More Information

View File

@ -1,19 +1,27 @@
open Expecto open Expecto
open BitBadger.Documents.Tests.CSharp open BitBadger.Documents.Tests.CSharp
let postgresOnly =
match System.Environment.GetEnvironmentVariable "BBDOX_PG_ONLY" with
| null -> false
| "true" -> true
| _ -> false
let allTests = let allTests =
testList testList "BitBadger.Documents" [
"BitBadger.Documents" if not postgresOnly then
[ CommonTests.all CommonTests.all
CommonCSharpTests.Unit CommonCSharpTests.Unit
PostgresTests.all PostgresTests.all
PostgresCSharpTests.All PostgresCSharpTests.All
PostgresExtensionTests.integrationTests PostgresExtensionTests.integrationTests
testSequenced PostgresCSharpExtensionTests.Integration testSequenced PostgresCSharpExtensionTests.Integration
SqliteTests.all if not postgresOnly then
SqliteCSharpTests.All SqliteTests.all
SqliteExtensionTests.integrationTests SqliteCSharpTests.All
testSequenced SqliteCSharpExtensionTests.Integration ] SqliteExtensionTests.integrationTests
testSequenced SqliteCSharpExtensionTests.Integration
]
[<EntryPoint>] [<EntryPoint>]
let main args = runTestsWithCLIArgs [] args allTests let main args = runTestsWithCLIArgs [] args allTests

13
src/package.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
echo --- Package Common library
dotnet pack Common/BitBadger.Documents.Common.fsproj -c Release
cp Common/bin/Release/BitBadger.Documents.Common.*.nupkg .
echo --- Package PostgreSQL library
dotnet pack Postgres/BitBadger.Documents.Postgres.fsproj -c Release
cp Postgres/bin/Release/BitBadger.Documents.Postgres.*.nupkg .
echo --- Package SQLite library
dotnet pack Sqlite/BitBadger.Documents.Sqlite.fsproj -c Release
cp Sqlite/bin/Release/BitBadger.Documents.Sqlite.*.nupkg .

33
src/test_all.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
dotnet clean BitBadger.Documents.sln
dotnet restore BitBadger.Documents.sln
dotnet build BitBadger.Documents.sln --no-restore
cd ./Tests || exit
export BBDOX_PG_PORT=8301
PG_VERSIONS=('12' '13' '14' '15' 'latest')
NET_VERSIONS=('6.0' '7.0' '8.0')
for PG_VERSION in "${PG_VERSIONS[@]}"
do
echo Starting PostgreSQL:$PG_VERSION
docker run -d -p $BBDOX_PG_PORT:5432 --name pg_test -e POSTGRES_PASSWORD=postgres postgres:$PG_VERSION
sleep 4
for NET_VERSION in "${NET_VERSIONS[@]}"
do
if [ "$PG_VERSION" = "latest" ]; then
echo Testing SQLite and PostgreSQL under .NET $NET_VERSION...
dotnet run -f net$NET_VERSION
else
echo Testing PostgreSQL v$PG_VERSION under .NET $NET_VERSION...
BBDOX_PG_ONLY="true" dotnet run -f net$NET_VERSION
fi
done
docker stop pg_test
sleep 2
docker rm pg_test
done
cd .. || exit