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);
 }
Exemple #2
0
 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,
     });
Exemple #3
0
        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;
 }
Exemple #7
0
 protected override IDbConnection CreateConnectionInternal(string connectionString)
 {
     NamingConvention = DB2iSeriesTools.GetDB2iSeriesNamingConvention(connectionString);
     return(base.CreateConnectionInternal(connectionString));
 }
Exemple #8
0
 public DB2iSeriesSqlBuilder7_2(ISqlOptimizer sqlOptimizer, SqlProviderFlags sqlProviderFlags,
                                ValueToSqlConverter valueToSqlConverter, DB2iSeriesNamingConvention namingConvention = default)
     : base(sqlOptimizer, sqlProviderFlags, valueToSqlConverter, namingConvention)
 {
 }
Exemple #9
0
 private static char GetSeparator(DB2iSeriesNamingConvention naming)
 {
     return(naming == DB2iSeriesNamingConvention.System ? '/' : '.');
 }
Exemple #10
0
 public static string GetTableName(string schema, string table, DB2iSeriesNamingConvention naming = default)
 {
     return(schema + GetSeparator(naming) + table);
 }
Exemple #11
0
 public static string iSeriesDummyTableName(DB2iSeriesNamingConvention naming = default)
 {
     return(string.Format("SYSIBM{0}SYSDUMMY1", GetSeparator(naming)));
 }
Exemple #12
0
 public static string Separator(this DB2iSeriesNamingConvention naming) => naming != DB2iSeriesNamingConvention.System ? "." : "/";
Exemple #13
0
 public static string SelectIdentityFromDummyTableSql(this DB2iSeriesNamingConvention naming) => $"SELECT {DB2iSeriesConstants.IdentityColumnSql} FROM {naming.DummyTableWithSchema()}";
Exemple #14
0
 public static string QualifiedObject(this DB2iSeriesNamingConvention naming, string prefix, string suffix) => prefix + naming.Separator() + suffix;
Exemple #15
0
 public static string DummyTableWithSchema(this DB2iSeriesNamingConvention naming) => DB2iSeriesConstants.DummyTableSchema + naming.Separator() + DB2iSeriesConstants.DummyTableName;