mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 18:52:50 +08:00
- 完善 达梦 DbFirst 支持视图;
This commit is contained in:
parent
dddfbe56af
commit
8373411f63
@ -33,6 +33,9 @@ namespace FreeSql.Tests.Dameng
|
|||||||
Assert.Equal(t1.Columns.Count, t2.Columns.Count);
|
Assert.Equal(t1.Columns.Count, t2.Columns.Count);
|
||||||
var t3 = fsql.DbFirst.GetTableByName("notexists_tb");
|
var t3 = fsql.DbFirst.GetTableByName("notexists_tb");
|
||||||
Assert.Null(t3);
|
Assert.Null(t3);
|
||||||
|
|
||||||
|
var t4 = fsql.DbFirst.GetTableByName("v_2user_v1");
|
||||||
|
Assert.NotNull(t4);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
@ -270,7 +270,19 @@ b.comments,
|
|||||||
'TABLE'
|
'TABLE'
|
||||||
from all_tables a
|
from all_tables a
|
||||||
left join all_tab_comments b on b.owner = a.owner and b.table_name = a.table_name and b.table_type = 'TABLE'
|
left join all_tab_comments b on b.owner = a.owner and b.table_name = a.table_name and b.table_type = 'TABLE'
|
||||||
where {(ignoreCase ? "lower(a.owner)" : "a.owner")} in ({databaseIn}){(tbname == null ? "" : $" and {(ignoreCase ? "lower(a.table_name)" : "a.table_name")}={_commonUtils.FormatSql("{0}", tbname[1])}")}";
|
where {(ignoreCase ? "lower(a.owner)" : "a.owner")} in ({databaseIn}){(tbname == null ? "" : $" and {(ignoreCase ? "lower(a.table_name)" : "a.table_name")}={_commonUtils.FormatSql("{0}", tbname[1])}")}
|
||||||
|
|
||||||
|
UNION ALL
|
||||||
|
|
||||||
|
select
|
||||||
|
a.owner || '.' || a.view_name,
|
||||||
|
a.owner,
|
||||||
|
a.view_name,
|
||||||
|
b.comments,
|
||||||
|
'VIEW' AS tp
|
||||||
|
from all_views a
|
||||||
|
left join all_tab_comments b on b.owner = a.owner and b.table_name = a.view_name and b.table_type = 'VIEW'
|
||||||
|
where {(ignoreCase ? "lower(a.owner)" : "a.owner")} in ({databaseIn}){(tbname == null ? "" : $" and {(ignoreCase ? "lower(a.view_name)" : "a.view_name")}={_commonUtils.FormatSql("{0}", tbname[1])}")}";
|
||||||
var ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
|
var ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
|
||||||
if (ds == null) return loc1;
|
if (ds == null) return loc1;
|
||||||
|
|
||||||
|
@ -270,7 +270,19 @@ b.comments,
|
|||||||
'TABLE'
|
'TABLE'
|
||||||
from all_tables a
|
from all_tables a
|
||||||
left join all_tab_comments b on b.owner = a.owner and b.table_name = a.table_name and b.table_type = 'TABLE'
|
left join all_tab_comments b on b.owner = a.owner and b.table_name = a.table_name and b.table_type = 'TABLE'
|
||||||
where {(ignoreCase ? "lower(a.owner)" : "a.owner")} in ({databaseIn}){(tbname == null ? "" : $" and {(ignoreCase ? "lower(a.table_name)" : "a.table_name")}={_commonUtils.FormatSql("{0}", tbname[1])}")}";
|
where {(ignoreCase ? "lower(a.owner)" : "a.owner")} in ({databaseIn}){(tbname == null ? "" : $" and {(ignoreCase ? "lower(a.table_name)" : "a.table_name")}={_commonUtils.FormatSql("{0}", tbname[1])}")}
|
||||||
|
|
||||||
|
UNION ALL
|
||||||
|
|
||||||
|
select
|
||||||
|
a.owner || '.' || a.view_name,
|
||||||
|
a.owner,
|
||||||
|
a.view_name,
|
||||||
|
b.comments,
|
||||||
|
'VIEW' AS tp
|
||||||
|
from all_views a
|
||||||
|
left join all_tab_comments b on b.owner = a.owner and b.table_name = a.view_name and b.table_type = 'VIEW'
|
||||||
|
where {(ignoreCase ? "lower(a.owner)" : "a.owner")} in ({databaseIn}){(tbname == null ? "" : $" and {(ignoreCase ? "lower(a.view_name)" : "a.view_name")}={_commonUtils.FormatSql("{0}", tbname[1])}")}";
|
||||||
var ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
|
var ds = _orm.Ado.ExecuteArray(CommandType.Text, sql);
|
||||||
if (ds == null) return loc1;
|
if (ds == null) return loc1;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user