Class PostgreSqlDataSource.
Inheritance: PostgreSqlDataSourceBase, IRootDataSource
Beispiel #1
0
 static TestBase()
 {
     Setup.AssemblyInit();
     foreach (ConnectionStringSettings con in ConfigurationManager.ConnectionStrings)
     {
         var ds = new PostgreSqlDataSource(con.Name, con.ConnectionString);
         if (s_PrimaryDataSource == null) s_PrimaryDataSource = ds;
         s_DataSources.Add(con.Name, ds);
     }
 }
Beispiel #2
0
        //public string TableFunction2Name { get { return "Sales.CustomersByStateInline"; } }

        public PostgreSqlDataSource AttachRules(PostgreSqlDataSource source)
        {
            return source.WithRules(
                new DateTimeRule("CreatedDate", DateTimeKind.Local, OperationTypes.Insert),
                new DateTimeRule("UpdatedDate", DateTimeKind.Local, OperationTypes.InsertOrUpdate),
                new UserDataRule("CreatedByKey", "EmployeeKey", OperationTypes.Insert),
                new UserDataRule("UpdatedByKey", "EmployeeKey", OperationTypes.InsertOrUpdate),
                new ValidateWithValidatable(OperationTypes.InsertOrUpdate)
                );
        }
Beispiel #3
0
        public PostgreSqlDataSource WithSettings(PostgreSqlDataSourceSettings settings)
        {
            var mergedSettings = new PostgreSqlDataSourceSettings()
            {
                DefaultCommandTimeout = settings?.DefaultCommandTimeout ?? DefaultCommandTimeout,
                SuppressGlobalEvents  = settings?.SuppressGlobalEvents ?? SuppressGlobalEvents,
                StrictMode            = settings?.StrictMode ?? StrictMode
            };
            var result = new PostgreSqlDataSource(Name, m_ConnectionBuilder, mergedSettings, m_DatabaseMetadata, m_Cache, m_ExtensionCache);

            result.m_DatabaseMetadata = m_DatabaseMetadata;
            result.AuditRules         = AuditRules;
            result.UserValue          = UserValue;

            result.ExecutionStarted  += (sender, e) => OnExecutionStarted(e);
            result.ExecutionFinished += (sender, e) => OnExecutionFinished(e);
            result.ExecutionError    += (sender, e) => OnExecutionError(e);
            result.ExecutionCanceled += (sender, e) => OnExecutionCanceled(e);

            return(result);
        }
Beispiel #4
0
 static TestBase()
 {
     s_DataSource = PostgreSqlDataSource.CreateFromConfig("PostgreSqlTestDatabase");
     s_StrictDataSource = s_DataSource.WithSettings(new PostgreSqlDataSourceSettings() { StrictMode = true });
 }
Beispiel #5
0
        public PostgreSqlDataSource WithSettings(PostgreSqlDataSourceSettings settings)
        {
            var mergedSettings = new PostgreSqlDataSourceSettings()
            {
                DefaultCommandTimeout = settings?.DefaultCommandTimeout ?? DefaultCommandTimeout,
                SuppressGlobalEvents = settings?.SuppressGlobalEvents ?? SuppressGlobalEvents,
                StrictMode = settings?.StrictMode ?? StrictMode
            };
            var result = new PostgreSqlDataSource(Name, m_ConnectionBuilder, mergedSettings, m_DatabaseMetadata, m_Cache, m_ExtensionCache);
            result.m_DatabaseMetadata = m_DatabaseMetadata;
            result.AuditRules = AuditRules;
            result.UserValue = UserValue;

            result.ExecutionStarted += (sender, e) => OnExecutionStarted(e);
            result.ExecutionFinished += (sender, e) => OnExecutionFinished(e);
            result.ExecutionError += (sender, e) => OnExecutionError(e);
            result.ExecutionCanceled += (sender, e) => OnExecutionCanceled(e);

            return result;
        }