mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 10:42:52 +08:00
- 修复 Firebird CodeFirst.SyncStructure 自增错误;d154a463a5d239c0a4ce848f2ac9c75dca84ec55
This commit is contained in:
parent
ad0df485a3
commit
e3d526ec6d
@ -1,4 +1,5 @@
|
||||
using FreeSql;
|
||||
using FreeSql.DataAnnotations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
@ -57,3 +58,11 @@ public class User1 : BaseEntity<User1, Guid>
|
||||
[MaxLength(4000)]
|
||||
public string Description { get; set; }
|
||||
}
|
||||
|
||||
public class IdentityTable
|
||||
{
|
||||
[Column(IsIdentity = true, IsPrimary = true)]
|
||||
public int id { get; set; }
|
||||
|
||||
public string name { get; set; }
|
||||
}
|
@ -451,10 +451,10 @@ namespace base_entity
|
||||
//.UseSlaveWeight(10, 1, 1, 5)
|
||||
|
||||
|
||||
//.UseConnectionString(FreeSql.DataType.Firebird, @"database=localhost:D:\fbdata\EXAMPLES.fdb;user=sysdba;password=123456;max pool size=5")
|
||||
.UseConnectionString(FreeSql.DataType.Firebird, @"database=localhost:D:\fbdata\EXAMPLES.fdb;user=sysdba;password=123456;max pool size=5")
|
||||
|
||||
|
||||
.UseConnectionString(FreeSql.DataType.MySql, "Data Source=127.0.0.1;Port=3306;User ID=root;Password=root;Initial Catalog=cccddd;Charset=utf8;SslMode=none;min pool size=1;Max pool size=2")
|
||||
//.UseConnectionString(FreeSql.DataType.MySql, "Data Source=127.0.0.1;Port=3306;User ID=root;Password=root;Initial Catalog=cccddd;Charset=utf8;SslMode=none;min pool size=1;Max pool size=2")
|
||||
|
||||
//.UseConnectionString(FreeSql.DataType.SqlServer, "Data Source=.;Integrated Security=True;Initial Catalog=freesqlTest;Pooling=true;Max Pool Size=3;TrustServerCertificate=true")
|
||||
|
||||
@ -487,6 +487,8 @@ namespace base_entity
|
||||
BaseEntity.Initialization(fsql, () => _asyncUow.Value);
|
||||
#endregion
|
||||
|
||||
fsql.Select<IdentityTable>().Count();
|
||||
|
||||
var dkdksql = fsql.Select<User1>().WithLock().From<UserGroup>()
|
||||
.InnerJoin<UserGroup>((user, usergroup) => user.GroupId == usergroup.Id && usergroup.GroupName == "xxx")
|
||||
.ToSql();
|
||||
|
@ -22,6 +22,7 @@ namespace FreeSql.Generator
|
||||
string ArgsConnectionString { get; }
|
||||
string ArgsFilter { get; }
|
||||
string ArgsMatch { get; }
|
||||
string ArgsJson { get; }
|
||||
string ArgsFileName { get; }
|
||||
bool ArgsReadKey { get; }
|
||||
internal string ArgsOutput { get; private set; }
|
||||
@ -62,6 +63,7 @@ new Colorful.Formatter("v" + string.Join(".", typeof(ConsoleApp).Assembly.GetNam
|
||||
ArgsNameSpace = "MyProject";
|
||||
ArgsFilter = "";
|
||||
ArgsMatch = "";
|
||||
ArgsJson = "Newtonsoft.Json";
|
||||
ArgsFileName = "{name}.cs";
|
||||
ArgsReadKey = true;
|
||||
Action<string> setArgsOutput = value =>
|
||||
@ -94,7 +96,7 @@ new Colorful.Formatter("v" + string.Join(".", typeof(ConsoleApp).Assembly.GetNam
|
||||
|
||||
-NameOptions * 4个布尔值对应:
|
||||
首字母大写
|
||||
首字母大写,其他小写
|
||||
首字母大写,其他小写
|
||||
全部小写
|
||||
下划线转驼峰
|
||||
|
||||
@ -116,6 +118,8 @@ new Colorful.Formatter("v" + string.Join(".", typeof(ConsoleApp).Assembly.GetNam
|
||||
如果不想生成视图和存储过程 -Filter View+StoreProcedure
|
||||
|
||||
-Match 表名或正则表达式,只生成匹配的表,如:dbo\.TB_.+
|
||||
-Json NTJ、STJ、NONE
|
||||
Newtonsoft.Json、System.Text.Json、不生成
|
||||
|
||||
-FileName 文件名,默认:{name}.cs
|
||||
-Output 保存路径,默认为当前 shell 所在目录
|
||||
@ -196,6 +200,18 @@ new Colorful.Formatter("推荐在实体类目录创建 gen.bat,双击它重新
|
||||
if (Regex.IsMatch("", ArgsMatch)) { } //throw
|
||||
a++;
|
||||
break;
|
||||
case "-json":
|
||||
switch(args[a + 1].Trim().ToLower())
|
||||
{
|
||||
case "none":
|
||||
ArgsJson = "";
|
||||
break;
|
||||
case "stj":
|
||||
ArgsJson = "System.Text.Json";
|
||||
break;
|
||||
}
|
||||
a++;
|
||||
break;
|
||||
case "-filename":
|
||||
ArgsFileName = args[a + 1];
|
||||
a++;
|
||||
|
@ -516,7 +516,9 @@ namespace FreeSql.Internal
|
||||
foreach (var col in trytb.Primarys)
|
||||
{
|
||||
col.Attribute.IsNullable = false;
|
||||
col.Attribute.DbType = col.Attribute.DbType.Replace("NOT NULL", "").Replace(" NULL", "").Trim() + " NOT NULL"; //sqlite 主键也可以插入 null
|
||||
col.Attribute.DbType = col.Attribute.DbType.Replace("NOT NULL", "").Replace(" NULL", "").Trim();
|
||||
if (common._orm.Ado.DataType == DataType.Sqlite)
|
||||
col.Attribute.DbType += " NOT NULL"; //sqlite 主键也可以插入 null
|
||||
}
|
||||
foreach (var col in trytb.Columns.Values)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user