Skip to content

Commit d57b94c

Browse files
authored
Merge pull request #6522 from bitfoundation/develop
Version 8.7.0 (#6519)
2 parents b8c7e83 + 16e7673 commit d57b94c

File tree

277 files changed

+5682
-1160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

277 files changed

+5682
-1160
lines changed

.github/workflows/bit.full.ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ jobs:
4242
4343
- name: Release build empty sample + offline db + Win exe
4444
run: |
45-
dotnet new bit-bp --name EmptyBP --database other --sample none --pipeline azure --offlineDb --Windows
45+
dotnet new bit-bp --name EmptyBP --database other --sample none --pipeline azure --offlineDb --windows
4646
dotnet build EmptyBP/EmptyBP.sln -c Release -p:RunAOTCompilation=false -p:EnableWindowsTargeting=true
4747
4848
- name: Release build admin panel sample + SqlServer database
4949
run: |
5050
dotnet new bit-bp --name AdminBPSqlServer --database sqlserver --sample admin --pipeline github
5151
dotnet build AdminBPSqlServer/AdminBPSqlServer.sln -c Release
5252
53-
- name: Release build bit blazor ui + butil + bswu + bup + code analyzers + source generators
53+
- name: Release build bit blazor ui + butil + bswup + besql + bup + code analyzers + source generators
5454
run: dotnet build src/Bit-CI-release.sln -c Release
5555

5656
- name: Release build careers, platform, sales websites

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
![Code size](https://img.shields.io/github/languages/code-size/bitfoundation/bitplatform.svg?logo=github)
77
![CI Status](https://github.com/bitfoundation/bitplatform/actions/workflows/bit.ci.yml/badge.svg)
88
![NuGet version](https://img.shields.io/nuget/v/bit.blazorui.svg?logo=nuget)
9-
[![Nuget downloads](https://img.shields.io/badge/packages_download-3.9M-blue.svg?logo=nuget)](https://www.nuget.org/profiles/bit-foundation)
9+
[![Nuget downloads](https://img.shields.io/badge/packages_download-4.4M-blue.svg?logo=nuget)](https://www.nuget.org/profiles/bit-foundation)
1010

1111
<br/>
1212

src/Besql/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/Demo/Bit.Besql.Demo/Offline-ClientDb.db*

src/Besql/Bit.Besql.sln

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.9.34321.82
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bit.Besql", "Bit.Besql\Bit.Besql.csproj", "{09B2C633-C120-4B89-A3FF-A1F9F76D42C5}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bit.Besql", "Bit.Besql\Bit.Besql.csproj", "{09B2C633-C120-4B89-A3FF-A1F9F76D42C5}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demo", "Demo", "{D35063A3-5CB7-4844-BFDF-FA0C997A6AC3}"
9+
EndProject
10+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bit.Besql.Demo", "Demo\Bit.Besql.Demo\Bit.Besql.Demo.csproj", "{AD10388C-DCDE-4720-864B-DB2BDB61B16A}"
11+
EndProject
12+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bit.Besql.Demo.Client", "Demo\Bit.Besql.Demo.Client\Bit.Besql.Demo.Client.csproj", "{BA753236-EB1B-438A-B17C-4D1721E14A91}"
713
EndProject
814
Global
915
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -15,10 +21,22 @@ Global
1521
{09B2C633-C120-4B89-A3FF-A1F9F76D42C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
1622
{09B2C633-C120-4B89-A3FF-A1F9F76D42C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
1723
{09B2C633-C120-4B89-A3FF-A1F9F76D42C5}.Release|Any CPU.Build.0 = Release|Any CPU
24+
{AD10388C-DCDE-4720-864B-DB2BDB61B16A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25+
{AD10388C-DCDE-4720-864B-DB2BDB61B16A}.Debug|Any CPU.Build.0 = Debug|Any CPU
26+
{AD10388C-DCDE-4720-864B-DB2BDB61B16A}.Release|Any CPU.ActiveCfg = Release|Any CPU
27+
{AD10388C-DCDE-4720-864B-DB2BDB61B16A}.Release|Any CPU.Build.0 = Release|Any CPU
28+
{BA753236-EB1B-438A-B17C-4D1721E14A91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29+
{BA753236-EB1B-438A-B17C-4D1721E14A91}.Debug|Any CPU.Build.0 = Debug|Any CPU
30+
{BA753236-EB1B-438A-B17C-4D1721E14A91}.Release|Any CPU.ActiveCfg = Release|Any CPU
31+
{BA753236-EB1B-438A-B17C-4D1721E14A91}.Release|Any CPU.Build.0 = Release|Any CPU
1832
EndGlobalSection
1933
GlobalSection(SolutionProperties) = preSolution
2034
HideSolutionNode = FALSE
2135
EndGlobalSection
36+
GlobalSection(NestedProjects) = preSolution
37+
{AD10388C-DCDE-4720-864B-DB2BDB61B16A} = {D35063A3-5CB7-4844-BFDF-FA0C997A6AC3}
38+
{BA753236-EB1B-438A-B17C-4D1721E14A91} = {D35063A3-5CB7-4844-BFDF-FA0C997A6AC3}
39+
EndGlobalSection
2240
GlobalSection(ExtensibilityGlobals) = postSolution
2341
SolutionGuid = {A4474E62-EBBF-4C5C-B256-EDA41E47EDC3}
2442
EndGlobalSection

src/Besql/Bit.Besql/BrowserCacheBesqlStorage.cs

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,10 @@
22

33
namespace Bit.Besql;
44

5-
public sealed class BrowserCacheBesqlStorage : IAsyncDisposable, IBesqlStorage
5+
public sealed class BrowserCacheBesqlStorage(IJSRuntime jsRuntime) : IBesqlStorage
66
{
7-
private readonly Lazy<Task<IJSObjectReference>> moduleTask;
8-
9-
public BrowserCacheBesqlStorage(IJSRuntime jsRuntime)
10-
{
11-
moduleTask = new(() => jsRuntime.InvokeAsync<IJSObjectReference>(
12-
"import", "./_content/Bit.Besql/browserCache.js").AsTask()!);
13-
}
14-
15-
public async ValueTask DisposeAsync()
16-
{
17-
if (moduleTask.IsValueCreated)
18-
{
19-
var module = await moduleTask.Value;
20-
await module.DisposeAsync();
21-
}
22-
}
23-
247
public async Task<int> SyncDb(string filename)
258
{
26-
var module = await moduleTask.Value;
27-
return await module.InvokeAsync<int>("synchronizeDbWithCache", filename);
9+
return await jsRuntime.InvokeAsync<int>("synchronizeDbWithCache", filename);
2810
}
2911
}

src/Besql/Bit.Besql/wwwroot/browserCache.js renamed to src/Besql/Bit.Besql/wwwroot/bit-besql.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export async function synchronizeDbWithCache(file) {
1+
async function synchronizeDbWithCache(file) {
22

33
window.sqlitedb = window.sqlitedb || {
44
init: false,
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
8+
<StaticWebAssetProjectMode>Default</StaticWebAssetProjectMode>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
13+
</ItemGroup>
14+
15+
<ItemGroup>
16+
<ProjectReference Include="..\..\Bit.Besql\Bit.Besql.csproj" />
17+
</ItemGroup>
18+
19+
</Project>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// <auto-generated />
2+
using Microsoft.EntityFrameworkCore.Infrastructure;
3+
using Microsoft.EntityFrameworkCore.Metadata;
4+
5+
#pragma warning disable 219, 612, 618
6+
#nullable disable
7+
8+
namespace Bit.Besql.Demo.Client.Data.CompiledModel
9+
{
10+
[DbContext(typeof(OfflineDbContext))]
11+
public partial class OfflineDbContextModel : RuntimeModel
12+
{
13+
private static readonly bool _useOldBehavior31751 =
14+
System.AppContext.TryGetSwitch("Microsoft.EntityFrameworkCore.Issue31751", out var enabled31751) && enabled31751;
15+
16+
static OfflineDbContextModel()
17+
{
18+
var model = new OfflineDbContextModel();
19+
20+
if (_useOldBehavior31751)
21+
{
22+
model.Initialize();
23+
}
24+
else
25+
{
26+
var thread = new System.Threading.Thread(RunInitialization, 10 * 1024 * 1024);
27+
thread.Start();
28+
thread.Join();
29+
30+
void RunInitialization()
31+
{
32+
model.Initialize();
33+
}
34+
}
35+
36+
model.Customize();
37+
_instance = model;
38+
}
39+
40+
private static OfflineDbContextModel _instance;
41+
public static IModel Instance => _instance;
42+
43+
partial void Initialize();
44+
45+
partial void Customize();
46+
}
47+
}
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
// <auto-generated />
2+
using System;
3+
using System.Collections.Generic;
4+
using Microsoft.EntityFrameworkCore;
5+
using Microsoft.EntityFrameworkCore.Infrastructure;
6+
using Microsoft.EntityFrameworkCore.Metadata;
7+
using Microsoft.EntityFrameworkCore.Metadata.Internal;
8+
9+
#pragma warning disable 219, 612, 618
10+
#nullable disable
11+
12+
namespace Bit.Besql.Demo.Client.Data.CompiledModel
13+
{
14+
public partial class OfflineDbContextModel
15+
{
16+
partial void Initialize()
17+
{
18+
var weatherForecast = WeatherForecastEntityType.Create(this);
19+
20+
WeatherForecastEntityType.CreateAnnotations(weatherForecast);
21+
22+
AddAnnotation("ProductVersion", "8.0.0");
23+
AddRuntimeAnnotation("Relational:RelationalModel", CreateRelationalModel());
24+
}
25+
26+
private IRelationalModel CreateRelationalModel()
27+
{
28+
var relationalModel = new RelationalModel(this);
29+
30+
var weatherForecast = FindEntityType("Bit.Besql.Demo.Client.Model.WeatherForecast")!;
31+
32+
var defaultTableMappings = new List<TableMappingBase<ColumnMappingBase>>();
33+
weatherForecast.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings);
34+
var bitBesqlSampleClientModelWeatherForecastTableBase = new TableBase("Bit.Besql.Demo.Client.Model.WeatherForecast", null, relationalModel);
35+
var dateColumnBase = new ColumnBase<ColumnMappingBase>("Date", "INTEGER", bitBesqlSampleClientModelWeatherForecastTableBase);
36+
bitBesqlSampleClientModelWeatherForecastTableBase.Columns.Add("Date", dateColumnBase);
37+
var idColumnBase = new ColumnBase<ColumnMappingBase>("Id", "INTEGER", bitBesqlSampleClientModelWeatherForecastTableBase);
38+
bitBesqlSampleClientModelWeatherForecastTableBase.Columns.Add("Id", idColumnBase);
39+
var summaryColumnBase = new ColumnBase<ColumnMappingBase>("Summary", "TEXT", bitBesqlSampleClientModelWeatherForecastTableBase)
40+
{
41+
IsNullable = true
42+
};
43+
bitBesqlSampleClientModelWeatherForecastTableBase.Columns.Add("Summary", summaryColumnBase);
44+
var temperatureCColumnBase = new ColumnBase<ColumnMappingBase>("TemperatureC", "INTEGER", bitBesqlSampleClientModelWeatherForecastTableBase);
45+
bitBesqlSampleClientModelWeatherForecastTableBase.Columns.Add("TemperatureC", temperatureCColumnBase);
46+
relationalModel.DefaultTables.Add("Bit.Besql.Demo.Client.Model.WeatherForecast", bitBesqlSampleClientModelWeatherForecastTableBase);
47+
var bitBesqlSampleClientModelWeatherForecastMappingBase = new TableMappingBase<ColumnMappingBase>(weatherForecast, bitBesqlSampleClientModelWeatherForecastTableBase, true);
48+
bitBesqlSampleClientModelWeatherForecastTableBase.AddTypeMapping(bitBesqlSampleClientModelWeatherForecastMappingBase, false);
49+
defaultTableMappings.Add(bitBesqlSampleClientModelWeatherForecastMappingBase);
50+
RelationalModel.CreateColumnMapping((ColumnBase<ColumnMappingBase>)idColumnBase, weatherForecast.FindProperty("Id")!, bitBesqlSampleClientModelWeatherForecastMappingBase);
51+
RelationalModel.CreateColumnMapping((ColumnBase<ColumnMappingBase>)dateColumnBase, weatherForecast.FindProperty("Date")!, bitBesqlSampleClientModelWeatherForecastMappingBase);
52+
RelationalModel.CreateColumnMapping((ColumnBase<ColumnMappingBase>)summaryColumnBase, weatherForecast.FindProperty("Summary")!, bitBesqlSampleClientModelWeatherForecastMappingBase);
53+
RelationalModel.CreateColumnMapping((ColumnBase<ColumnMappingBase>)temperatureCColumnBase, weatherForecast.FindProperty("TemperatureC")!, bitBesqlSampleClientModelWeatherForecastMappingBase);
54+
55+
var tableMappings = new List<TableMapping>();
56+
weatherForecast.SetRuntimeAnnotation("Relational:TableMappings", tableMappings);
57+
var weatherForecastsTable = new Table("WeatherForecasts", null, relationalModel);
58+
var idColumn = new Column("Id", "INTEGER", weatherForecastsTable);
59+
weatherForecastsTable.Columns.Add("Id", idColumn);
60+
var dateColumn = new Column("Date", "INTEGER", weatherForecastsTable);
61+
weatherForecastsTable.Columns.Add("Date", dateColumn);
62+
var summaryColumn = new Column("Summary", "TEXT", weatherForecastsTable)
63+
{
64+
IsNullable = true
65+
};
66+
weatherForecastsTable.Columns.Add("Summary", summaryColumn);
67+
var temperatureCColumn = new Column("TemperatureC", "INTEGER", weatherForecastsTable);
68+
weatherForecastsTable.Columns.Add("TemperatureC", temperatureCColumn);
69+
var pK_WeatherForecasts = new UniqueConstraint("PK_WeatherForecasts", weatherForecastsTable, new[] { idColumn });
70+
weatherForecastsTable.PrimaryKey = pK_WeatherForecasts;
71+
var pK_WeatherForecastsUc = RelationalModel.GetKey(this,
72+
"Bit.Besql.Demo.Client.Model.WeatherForecast",
73+
new[] { "Id" });
74+
pK_WeatherForecasts.MappedKeys.Add(pK_WeatherForecastsUc);
75+
RelationalModel.GetOrCreateUniqueConstraints(pK_WeatherForecastsUc).Add(pK_WeatherForecasts);
76+
weatherForecastsTable.UniqueConstraints.Add("PK_WeatherForecasts", pK_WeatherForecasts);
77+
var iX_WeatherForecasts_TemperatureC = new TableIndex(
78+
"IX_WeatherForecasts_TemperatureC", weatherForecastsTable, new[] { temperatureCColumn }, false);
79+
var iX_WeatherForecasts_TemperatureCIx = RelationalModel.GetIndex(this,
80+
"Bit.Besql.Demo.Client.Model.WeatherForecast",
81+
new[] { "TemperatureC" });
82+
iX_WeatherForecasts_TemperatureC.MappedIndexes.Add(iX_WeatherForecasts_TemperatureCIx);
83+
RelationalModel.GetOrCreateTableIndexes(iX_WeatherForecasts_TemperatureCIx).Add(iX_WeatherForecasts_TemperatureC);
84+
weatherForecastsTable.Indexes.Add("IX_WeatherForecasts_TemperatureC", iX_WeatherForecasts_TemperatureC);
85+
relationalModel.Tables.Add(("WeatherForecasts", null), weatherForecastsTable);
86+
var weatherForecastsTableMapping = new TableMapping(weatherForecast, weatherForecastsTable, true);
87+
weatherForecastsTable.AddTypeMapping(weatherForecastsTableMapping, false);
88+
tableMappings.Add(weatherForecastsTableMapping);
89+
RelationalModel.CreateColumnMapping(idColumn, weatherForecast.FindProperty("Id")!, weatherForecastsTableMapping);
90+
RelationalModel.CreateColumnMapping(dateColumn, weatherForecast.FindProperty("Date")!, weatherForecastsTableMapping);
91+
RelationalModel.CreateColumnMapping(summaryColumn, weatherForecast.FindProperty("Summary")!, weatherForecastsTableMapping);
92+
RelationalModel.CreateColumnMapping(temperatureCColumn, weatherForecast.FindProperty("TemperatureC")!, weatherForecastsTableMapping);
93+
return relationalModel.MakeReadOnly();
94+
}
95+
}
96+
}

0 commit comments

Comments
 (0)