mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
OpenGauss support bulkcopy
This commit is contained in:
parent
9fbf277d6e
commit
0d3a64475f
@ -39,6 +39,10 @@ namespace SqlSugar
|
||||
lsColNames.Add($"\"{dt.Columns[i].ColumnName}\"");
|
||||
}
|
||||
string copyString = $"COPY {dt.TableName} ( {string.Join(",", lsColNames) } ) FROM STDIN (FORMAT BINARY)";
|
||||
if (this.Context?.CurrentConnectionConfig?.MoreSettings?.DatabaseModel == DbType.OpenGauss)
|
||||
{
|
||||
copyString = copyString.Replace("(FORMAT BINARY)", "(FORMAT 'BINARY')");
|
||||
}
|
||||
NpgsqlConnection conn = (NpgsqlConnection)this.Context.Ado.Connection;
|
||||
var columns = this.Context.DbMaintenance.GetColumnInfosByTableName(this.entityInfo.DbTableName);
|
||||
try
|
||||
|
Loading…
Reference in New Issue
Block a user