clf.code.first 1.0.3

dotnet add package clf.code.first --version 1.0.3                
NuGet\Install-Package clf.code.first -Version 1.0.3                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="clf.code.first" Version="1.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add clf.code.first --version 1.0.3                
#r "nuget: clf.code.first, 1.0.3"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install clf.code.first as a Cake Addin
#addin nuget:?package=clf.code.first&version=1.0.3

// Install clf.code.first as a Cake Tool
#tool nuget:?package=clf.code.first&version=1.0.3                

code.first.mysql

​ 代码到数据库存的工具

要求

  1. 代码对业务工程,无侵入。
  2. 以类的字段为主,数据库字段在类字段没有的一律删除
  3. 只有 Table 注解标注的类才表示数据库中有表
  4. 没有Columns 注解标记的数据表中不保存

始策略

​ 开发模式:每一次启动(生成)处理

​ 生主环境:通过配制版本号(更新或重装,重置)后处理

运行时机

​ 宿主程序,主动调用;异步 运行 并报告进度信息

  1. 如果在 Debug 模式下,启动一次运行一次

    #if DEBUG
                string connstring = "Server=127.0.0.1;Database=test;User Id=admin;Password=Bnhq@1234;pooling=false;CharSet=utf8;port=3306";
                Assembly assembly = Assembly.GetExecutingAssembly();
                MainWorker.Run(assembly, connstring, CollBack);
    #else
    
    1. 在 RELEASE 模式下
      1. 程序更新时,运行
      2. 配制数据库,储存时运行


处理规则

​ 1.新加入的类,增加表 ​ 2.后加入的类,更新表 ​ 3.数据表中多余Table, 不处理

​ 1.新加入的类Field,增加Column ​ 2.后加入的类Field,更新表 Column ​ 3.数据表中多余Colum 删除

Attributes 特性 同理 Annotation 注解

  1. Table

    1. Name
    2. Comment
  2. Id

       1. AutoIncrement
       2. Type
    
  3. Columns

    1.Name

    1. Type
    2. Length
    3. IsNull
    4. Default
    5. Comment

类型对应表

C# class Type Len Mysql DB Type Len
bool tinyint
Int32 int integer
int64 bigint
Decmail decmail
Float Double double
String varchar text
其余的基本用不到

注意

  1. 主键 只会第一次构建时创建,一般是(id),后期修改主键无效。

优势

  1. 深度学习,得到提升
  2. 插件式项目,功能插件,可以自动生成数据库
    1. 可以不在同一台服务器
    2. 可以不是同一个数据库
    3. 插件的增加和删除,不影响原来的宿主项目

单独的 代码仓库管理

Git

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.3 398 11/22/2022
1.0.2 336 11/22/2022
1.0.1 349 11/22/2022
1.0.0 347 11/21/2022