コード例 #1
0
ファイル: CreateErrorTableTask.cs プロジェクト: etlbox/etlbox
        public void Execute()
        {
            if (DropAndCreateTable)
            {
                DropTableTask.DropIfExists(this.ConnectionManager, TableName);
            }

            CreateTableTask.CreateIfNotExists(this.ConnectionManager, TableName,
                                              new List <TableColumn>()
            {
                new TableColumn("ErrorText", "TEXT", allowNulls: false),
                new TableColumn("ExceptionType", "VARCHAR(1000)", allowNulls: false),
                new TableColumn("RecordAsJson", "TEXT", allowNulls: true),
                new TableColumn("ReportTime", "DATETIME", allowNulls: false),
            });
        }
コード例 #2
0
        public void CreateTable()
        {
            List <TableColumn> lpColumns = new List <TableColumn>()
            {
                new TableColumn("id", "BIGINT", allowNulls: false, isPrimaryKey: true, isIdentity: true),
                new TableColumn("start_date", "DATETIME", allowNulls: false),
                new TableColumn("end_date", "DATETIME", allowNulls: true),
                new TableColumn("source", "VARCHAR(20)", allowNulls: true),
                new TableColumn("source_id", "BIGINT", allowNulls: true),
                new TableColumn("process_name", "VARCHAR(100)", allowNulls: false)
                {
                    DefaultValue = "'N/A'"
                },
                new TableColumn("start_message", "VARCHAR(2000)", allowNulls: true),
                new TableColumn("is_running", "SMALLINT", allowNulls: false)
                {
                    DefaultValue = "1"
                },
                new TableColumn("end_message", "VARCHAR(2000)", allowNulls: true),
                new TableColumn("was_successful", "SMALLINT", allowNulls: false)
                {
                    DefaultValue = "0"
                },
                new TableColumn("abort_message", "VARCHAR(2000)", allowNulls: true),
                new TableColumn("was_aborted", "SMALLINT", allowNulls: false)
                {
                    DefaultValue = "0"
                }
            };
            CreateTableTask LoadProcessTable = new CreateTableTask(TableName, lpColumns)
            {
                DisableLogging = true
            };

            LoadProcessTable.CopyLogTaskProperties(this);
            LoadProcessTable.ConnectionManager = this.ConnectionManager;
            LoadProcessTable.DisableLogging    = true;
            LoadProcessTable.CreateIfNotExists();
            Logging.LoadProcessTable = TableName;
        }
コード例 #3
0
ファイル: LogTask.cs プロジェクト: etlbox/etlbox
        public void CreateLogTable()
        {
            List <TableColumn> columns = new List <TableColumn>()
            {
                new TableColumn("id", "BIGINT", allowNulls: false, isPrimaryKey: true, isIdentity: true),
                new TableColumn("log_date", "DATETIME", allowNulls: false),
                new TableColumn("level", "VARCHAR(10)", allowNulls: true),
                new TableColumn("stage", "VARCHAR(20)", allowNulls: true),
                new TableColumn("message", "VARCHAR(4000)", allowNulls: true),
                new TableColumn("task_name", "VARCHAR(1000)", allowNulls: true),
                new TableColumn("task_type", "VARCHAR(200)", allowNulls: true),
                new TableColumn("action", "VARCHAR(5)", allowNulls: true),
                new TableColumn("task_hash", "CHAR(40)", allowNulls: true),
                new TableColumn("source", "VARCHAR(20)", allowNulls: true),
                new TableColumn("load_process_id", "BIGINT", allowNulls: true)
            };
            var logTable = new CreateTableTask(TableName, columns);

            logTable.CopyLogTaskProperties(this);
            logTable.ConnectionManager = this.ConnectionManager;
            logTable.DisableLogging    = true;
            logTable.CreateIfNotExists();
            Logging.LogTable = TableName;
        }
コード例 #4
0
ファイル: TableDefinition.cs プロジェクト: PaulKov/etlbox
 /// <summary>
 /// Uses the CreateTableTask to create a table based on the current definition.
 /// </summary>
 /// <param name="connectionManager">The connection manager of the database you want to connect</param>
 public void CreateTable(IConnectionManager connectionManager) => CreateTableTask.CreateIfNotExists(connectionManager, this);
コード例 #5
0
ファイル: TableDefinition.cs プロジェクト: PaulKov/etlbox
 /// <summary>
 /// Uses the CreateTableTask to create a table based on the current definition.
 /// </summary>
 public void CreateTable() => CreateTableTask.CreateIfNotExists(this);