public DB2iSeriesSqlBuilder(ISqlOptimizer sqlOptimizer, SqlProviderFlags sqlProviderFlags, ValueToSqlConverter valueToSqlConverter, DB2iSeriesNamingConvention namingConvention = default) : base(sqlOptimizer, sqlProviderFlags, valueToSqlConverter) { NamingConvention = namingConvention; this.mapGuidAsString = sqlProviderFlags.CustomFlags.Contains(DB2iSeriesTools.MapGuidAsString); this.preventNVarChar = sqlProviderFlags.CustomFlags.Contains(DB2iSeriesTools.PreventNVarChar); }
public static IDataProvider GetDataProvider( DB2iSeriesVersionRelease versionRelease = DB2iSeriesVersionRelease.V5R4, DB2iSeriesNamingConvention naming = DB2iSeriesNamingConvention.System) { return((versionRelease, naming) switch { (DB2iSeriesVersionRelease.V5R4, DB2iSeriesNamingConvention) => _db2iSeriesDataProviderV5R4_System.Value, //PostgreSQLVersion.v93 => _postgreSQLDataProvider93.Value, //_ => _postgreSQLDataProvider92.Value, });
public static string iSeriesDummyTableName(DB2iSeriesNamingConvention naming = DB2iSeriesNamingConvention.System) { var seperator = (naming == DB2iSeriesNamingConvention.System) ? "/" : "."; return(string.Format("SYSIBM{0}SYSDUMMY1", seperator)); }
public static string DummyTableName(DB2iSeriesNamingConvention naming = DB2iSeriesNamingConvention.Sql) => naming == DB2iSeriesNamingConvention.Sql ? "SYSIBM.SYSDUMMY1" : "SYSIBM/SYSDUMMY1";
public static string Delimiter(DB2iSeriesNamingConvention naming = DB2iSeriesNamingConvention.Sql) => naming == DB2iSeriesNamingConvention.Sql ? "." : "/";
public xDB2iSeriesBulkCopy(DB2iSeriesNamingConvention naming) { this.naming = naming; }
protected override IDbConnection CreateConnectionInternal(string connectionString) { NamingConvention = DB2iSeriesTools.GetDB2iSeriesNamingConvention(connectionString); return(base.CreateConnectionInternal(connectionString)); }
public DB2iSeriesSqlBuilder7_2(ISqlOptimizer sqlOptimizer, SqlProviderFlags sqlProviderFlags, ValueToSqlConverter valueToSqlConverter, DB2iSeriesNamingConvention namingConvention = default) : base(sqlOptimizer, sqlProviderFlags, valueToSqlConverter, namingConvention) { }
private static char GetSeparator(DB2iSeriesNamingConvention naming) { return(naming == DB2iSeriesNamingConvention.System ? '/' : '.'); }
public static string GetTableName(string schema, string table, DB2iSeriesNamingConvention naming = default) { return(schema + GetSeparator(naming) + table); }
public static string iSeriesDummyTableName(DB2iSeriesNamingConvention naming = default) { return(string.Format("SYSIBM{0}SYSDUMMY1", GetSeparator(naming))); }
public static string Separator(this DB2iSeriesNamingConvention naming) => naming != DB2iSeriesNamingConvention.System ? "." : "/";
public static string SelectIdentityFromDummyTableSql(this DB2iSeriesNamingConvention naming) => $"SELECT {DB2iSeriesConstants.IdentityColumnSql} FROM {naming.DummyTableWithSchema()}";
public static string QualifiedObject(this DB2iSeriesNamingConvention naming, string prefix, string suffix) => prefix + naming.Separator() + suffix;
public static string DummyTableWithSchema(this DB2iSeriesNamingConvention naming) => DB2iSeriesConstants.DummyTableSchema + naming.Separator() + DB2iSeriesConstants.DummyTableName;