Skip to content

Commit

Permalink
Merge pull request #6522 from bitfoundation/develop
Browse files Browse the repository at this point in the history
Version 8.7.0 (#6519)
  • Loading branch information
msynk authored Jan 8, 2024
2 parents b8c7e83 + 16e7673 commit d57b94c
Show file tree
Hide file tree
Showing 277 changed files with 5,682 additions and 1,160 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bit.full.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ jobs:
- name: Release build empty sample + offline db + Win exe
run: |
dotnet new bit-bp --name EmptyBP --database other --sample none --pipeline azure --offlineDb --Windows
dotnet new bit-bp --name EmptyBP --database other --sample none --pipeline azure --offlineDb --windows
dotnet build EmptyBP/EmptyBP.sln -c Release -p:RunAOTCompilation=false -p:EnableWindowsTargeting=true
- name: Release build admin panel sample + SqlServer database
run: |
dotnet new bit-bp --name AdminBPSqlServer --database sqlserver --sample admin --pipeline github
dotnet build AdminBPSqlServer/AdminBPSqlServer.sln -c Release
- name: Release build bit blazor ui + butil + bswu + bup + code analyzers + source generators
- name: Release build bit blazor ui + butil + bswup + besql + bup + code analyzers + source generators
run: dotnet build src/Bit-CI-release.sln -c Release

- name: Release build careers, platform, sales websites
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
![Code size](https://img.shields.io/github/languages/code-size/bitfoundation/bitplatform.svg?logo=github)
![CI Status](https://github.com/bitfoundation/bitplatform/actions/workflows/bit.ci.yml/badge.svg)
![NuGet version](https://img.shields.io/nuget/v/bit.blazorui.svg?logo=nuget)
[![Nuget downloads](https://img.shields.io/badge/packages_download-3.9M-blue.svg?logo=nuget)](https://www.nuget.org/profiles/bit-foundation)
[![Nuget downloads](https://img.shields.io/badge/packages_download-4.4M-blue.svg?logo=nuget)](https://www.nuget.org/profiles/bit-foundation)

<br/>

Expand Down
1 change: 1 addition & 0 deletions src/Besql/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/Demo/Bit.Besql.Demo/Offline-ClientDb.db*
20 changes: 19 additions & 1 deletion src/Besql/Bit.Besql.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34321.82
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bit.Besql", "Bit.Besql\Bit.Besql.csproj", "{09B2C633-C120-4B89-A3FF-A1F9F76D42C5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bit.Besql", "Bit.Besql\Bit.Besql.csproj", "{09B2C633-C120-4B89-A3FF-A1F9F76D42C5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demo", "Demo", "{D35063A3-5CB7-4844-BFDF-FA0C997A6AC3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bit.Besql.Demo", "Demo\Bit.Besql.Demo\Bit.Besql.Demo.csproj", "{AD10388C-DCDE-4720-864B-DB2BDB61B16A}"
EndProject
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}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -15,10 +21,22 @@ Global
{09B2C633-C120-4B89-A3FF-A1F9F76D42C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09B2C633-C120-4B89-A3FF-A1F9F76D42C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09B2C633-C120-4B89-A3FF-A1F9F76D42C5}.Release|Any CPU.Build.0 = Release|Any CPU
{AD10388C-DCDE-4720-864B-DB2BDB61B16A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AD10388C-DCDE-4720-864B-DB2BDB61B16A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AD10388C-DCDE-4720-864B-DB2BDB61B16A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AD10388C-DCDE-4720-864B-DB2BDB61B16A}.Release|Any CPU.Build.0 = Release|Any CPU
{BA753236-EB1B-438A-B17C-4D1721E14A91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BA753236-EB1B-438A-B17C-4D1721E14A91}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BA753236-EB1B-438A-B17C-4D1721E14A91}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BA753236-EB1B-438A-B17C-4D1721E14A91}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{AD10388C-DCDE-4720-864B-DB2BDB61B16A} = {D35063A3-5CB7-4844-BFDF-FA0C997A6AC3}
{BA753236-EB1B-438A-B17C-4D1721E14A91} = {D35063A3-5CB7-4844-BFDF-FA0C997A6AC3}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A4474E62-EBBF-4C5C-B256-EDA41E47EDC3}
EndGlobalSection
Expand Down
22 changes: 2 additions & 20 deletions src/Besql/Bit.Besql/BrowserCacheBesqlStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,10 @@

namespace Bit.Besql;

public sealed class BrowserCacheBesqlStorage : IAsyncDisposable, IBesqlStorage
public sealed class BrowserCacheBesqlStorage(IJSRuntime jsRuntime) : IBesqlStorage
{
private readonly Lazy<Task<IJSObjectReference>> moduleTask;

public BrowserCacheBesqlStorage(IJSRuntime jsRuntime)
{
moduleTask = new(() => jsRuntime.InvokeAsync<IJSObjectReference>(
"import", "./_content/Bit.Besql/browserCache.js").AsTask()!);
}

public async ValueTask DisposeAsync()
{
if (moduleTask.IsValueCreated)
{
var module = await moduleTask.Value;
await module.DisposeAsync();
}
}

public async Task<int> SyncDb(string filename)
{
var module = await moduleTask.Value;
return await module.InvokeAsync<int>("synchronizeDbWithCache", filename);
return await jsRuntime.InvokeAsync<int>("synchronizeDbWithCache", filename);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export async function synchronizeDbWithCache(file) {
async function synchronizeDbWithCache(file) {

window.sqlitedb = window.sqlitedb || {
init: false,
Expand Down
19 changes: 19 additions & 0 deletions src/Besql/Demo/Bit.Besql.Demo.Client/Bit.Besql.Demo.Client.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
<StaticWebAssetProjectMode>Default</StaticWebAssetProjectMode>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Bit.Besql\Bit.Besql.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// <auto-generated />
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;

#pragma warning disable 219, 612, 618
#nullable disable

namespace Bit.Besql.Demo.Client.Data.CompiledModel
{
[DbContext(typeof(OfflineDbContext))]
public partial class OfflineDbContextModel : RuntimeModel
{
private static readonly bool _useOldBehavior31751 =
System.AppContext.TryGetSwitch("Microsoft.EntityFrameworkCore.Issue31751", out var enabled31751) && enabled31751;

static OfflineDbContextModel()
{
var model = new OfflineDbContextModel();

if (_useOldBehavior31751)
{
model.Initialize();
}
else
{
var thread = new System.Threading.Thread(RunInitialization, 10 * 1024 * 1024);
thread.Start();
thread.Join();

void RunInitialization()
{
model.Initialize();
}
}

model.Customize();
_instance = model;
}

private static OfflineDbContextModel _instance;
public static IModel Instance => _instance;

partial void Initialize();

partial void Customize();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
// <auto-generated />
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Metadata.Internal;

#pragma warning disable 219, 612, 618
#nullable disable

namespace Bit.Besql.Demo.Client.Data.CompiledModel
{
public partial class OfflineDbContextModel
{
partial void Initialize()
{
var weatherForecast = WeatherForecastEntityType.Create(this);

WeatherForecastEntityType.CreateAnnotations(weatherForecast);

AddAnnotation("ProductVersion", "8.0.0");
AddRuntimeAnnotation("Relational:RelationalModel", CreateRelationalModel());
}

private IRelationalModel CreateRelationalModel()
{
var relationalModel = new RelationalModel(this);

var weatherForecast = FindEntityType("Bit.Besql.Demo.Client.Model.WeatherForecast")!;

var defaultTableMappings = new List<TableMappingBase<ColumnMappingBase>>();
weatherForecast.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings);
var bitBesqlSampleClientModelWeatherForecastTableBase = new TableBase("Bit.Besql.Demo.Client.Model.WeatherForecast", null, relationalModel);
var dateColumnBase = new ColumnBase<ColumnMappingBase>("Date", "INTEGER", bitBesqlSampleClientModelWeatherForecastTableBase);
bitBesqlSampleClientModelWeatherForecastTableBase.Columns.Add("Date", dateColumnBase);
var idColumnBase = new ColumnBase<ColumnMappingBase>("Id", "INTEGER", bitBesqlSampleClientModelWeatherForecastTableBase);
bitBesqlSampleClientModelWeatherForecastTableBase.Columns.Add("Id", idColumnBase);
var summaryColumnBase = new ColumnBase<ColumnMappingBase>("Summary", "TEXT", bitBesqlSampleClientModelWeatherForecastTableBase)
{
IsNullable = true
};
bitBesqlSampleClientModelWeatherForecastTableBase.Columns.Add("Summary", summaryColumnBase);
var temperatureCColumnBase = new ColumnBase<ColumnMappingBase>("TemperatureC", "INTEGER", bitBesqlSampleClientModelWeatherForecastTableBase);
bitBesqlSampleClientModelWeatherForecastTableBase.Columns.Add("TemperatureC", temperatureCColumnBase);
relationalModel.DefaultTables.Add("Bit.Besql.Demo.Client.Model.WeatherForecast", bitBesqlSampleClientModelWeatherForecastTableBase);
var bitBesqlSampleClientModelWeatherForecastMappingBase = new TableMappingBase<ColumnMappingBase>(weatherForecast, bitBesqlSampleClientModelWeatherForecastTableBase, true);
bitBesqlSampleClientModelWeatherForecastTableBase.AddTypeMapping(bitBesqlSampleClientModelWeatherForecastMappingBase, false);
defaultTableMappings.Add(bitBesqlSampleClientModelWeatherForecastMappingBase);
RelationalModel.CreateColumnMapping((ColumnBase<ColumnMappingBase>)idColumnBase, weatherForecast.FindProperty("Id")!, bitBesqlSampleClientModelWeatherForecastMappingBase);
RelationalModel.CreateColumnMapping((ColumnBase<ColumnMappingBase>)dateColumnBase, weatherForecast.FindProperty("Date")!, bitBesqlSampleClientModelWeatherForecastMappingBase);
RelationalModel.CreateColumnMapping((ColumnBase<ColumnMappingBase>)summaryColumnBase, weatherForecast.FindProperty("Summary")!, bitBesqlSampleClientModelWeatherForecastMappingBase);
RelationalModel.CreateColumnMapping((ColumnBase<ColumnMappingBase>)temperatureCColumnBase, weatherForecast.FindProperty("TemperatureC")!, bitBesqlSampleClientModelWeatherForecastMappingBase);

var tableMappings = new List<TableMapping>();
weatherForecast.SetRuntimeAnnotation("Relational:TableMappings", tableMappings);
var weatherForecastsTable = new Table("WeatherForecasts", null, relationalModel);
var idColumn = new Column("Id", "INTEGER", weatherForecastsTable);
weatherForecastsTable.Columns.Add("Id", idColumn);
var dateColumn = new Column("Date", "INTEGER", weatherForecastsTable);
weatherForecastsTable.Columns.Add("Date", dateColumn);
var summaryColumn = new Column("Summary", "TEXT", weatherForecastsTable)
{
IsNullable = true
};
weatherForecastsTable.Columns.Add("Summary", summaryColumn);
var temperatureCColumn = new Column("TemperatureC", "INTEGER", weatherForecastsTable);
weatherForecastsTable.Columns.Add("TemperatureC", temperatureCColumn);
var pK_WeatherForecasts = new UniqueConstraint("PK_WeatherForecasts", weatherForecastsTable, new[] { idColumn });
weatherForecastsTable.PrimaryKey = pK_WeatherForecasts;
var pK_WeatherForecastsUc = RelationalModel.GetKey(this,
"Bit.Besql.Demo.Client.Model.WeatherForecast",
new[] { "Id" });
pK_WeatherForecasts.MappedKeys.Add(pK_WeatherForecastsUc);
RelationalModel.GetOrCreateUniqueConstraints(pK_WeatherForecastsUc).Add(pK_WeatherForecasts);
weatherForecastsTable.UniqueConstraints.Add("PK_WeatherForecasts", pK_WeatherForecasts);
var iX_WeatherForecasts_TemperatureC = new TableIndex(
"IX_WeatherForecasts_TemperatureC", weatherForecastsTable, new[] { temperatureCColumn }, false);
var iX_WeatherForecasts_TemperatureCIx = RelationalModel.GetIndex(this,
"Bit.Besql.Demo.Client.Model.WeatherForecast",
new[] { "TemperatureC" });
iX_WeatherForecasts_TemperatureC.MappedIndexes.Add(iX_WeatherForecasts_TemperatureCIx);
RelationalModel.GetOrCreateTableIndexes(iX_WeatherForecasts_TemperatureCIx).Add(iX_WeatherForecasts_TemperatureC);
weatherForecastsTable.Indexes.Add("IX_WeatherForecasts_TemperatureC", iX_WeatherForecasts_TemperatureC);
relationalModel.Tables.Add(("WeatherForecasts", null), weatherForecastsTable);
var weatherForecastsTableMapping = new TableMapping(weatherForecast, weatherForecastsTable, true);
weatherForecastsTable.AddTypeMapping(weatherForecastsTableMapping, false);
tableMappings.Add(weatherForecastsTableMapping);
RelationalModel.CreateColumnMapping(idColumn, weatherForecast.FindProperty("Id")!, weatherForecastsTableMapping);
RelationalModel.CreateColumnMapping(dateColumn, weatherForecast.FindProperty("Date")!, weatherForecastsTableMapping);
RelationalModel.CreateColumnMapping(summaryColumn, weatherForecast.FindProperty("Summary")!, weatherForecastsTableMapping);
RelationalModel.CreateColumnMapping(temperatureCColumn, weatherForecast.FindProperty("TemperatureC")!, weatherForecastsTableMapping);
return relationalModel.MakeReadOnly();
}
}
}
Loading

0 comments on commit d57b94c

Please sign in to comment.