Beispiel #1
0
        public StepResult GetResult(Process process, string databaseName)
        {
            var result = new StepResult();

            if (process.HasDatabase(databaseName))
            {
                var db      = process.GetDatabase2(databaseName);
                var columns = new ColumnSchema[Columns.Count];
                int i       = 1;
                int x       = 0;

                foreach (var column in Columns)
                {
                    columns[x] = GetColumnSchema(column, i);
                    x++;
                    i++;
                }

                var schema = new TableSchema2(columns, db.GetNextTableId(), TableName, databaseName, db.DatabaseId);
                var table  = new Table2(process, schema, db.Storage, process.Cache);
                db.AddTable(table);
            }
            else
            {
                result.IsValid      = false;
                result.ErrorMessage = $"{databaseName} was not found";
            }

            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// Adds a table to the database based on the passed in table schema
        /// </summary>
        /// <param name="schema">The table schema</param>
        public void AddTable(TableSchema2 schema)
        {
            var table = new Table2(_process, schema, this.Storage, _process.Cache);

            _tables.Add(table);
            HandleAddTable(table.Name);
        }
Beispiel #3
0
 /// <summary>
 /// Adds a table to the database
 /// </summary>
 /// <param name="table">The table to be added</param>
 public void AddTable(Table2 table)
 {
     if (table != null)
     {
         _tables.Add(table);
         HandleAddTable(table.Name);
     }
     else
     {
         throw new ArgumentNullException(nameof(table));
     }
 }
Beispiel #4
0
        /// <summary>
        /// Updates the db indexes if applicable for a row insert
        /// </summary>
        /// <param name="row">The row to b inserted</param>
        /// <returns>True if successful, otherwise false</returns>
        private bool UpdateIndexesForInsert(RowInsert row)
        {
            Table2 table = GetTable(row.Table.BTreeAddress);

            if (table.HasIndexes)
            {
                // need to update indexes if appropriate
            }

            //throw new NotImplementedException();
            return(true);
        }
Beispiel #5
0
 public void AddTable(Table2 table)
 {
     throw new NotImplementedException();
 }