Exemplo n.º 1
0
        internal Database(DatabaseSystem system, IDatabaseContext context)
        {
            System = system;
            Context = context;

            Name = Context.DatabaseName();

            DiscoverDataVersion();

            TableComposite = new TableSourceComposite(this);

            Context.RegisterInstance(this);
            Context.RegisterInstance<ITableSourceComposite>(TableComposite);

            Locker = new Locker(this);

            Sessions = new ActiveSessionList(this);

            // Create the single row table
            var t = new TemporaryTable(context, "SINGLE_ROW_TABLE", new ColumnInfo[0]);
            t.NewRow();
            SingleRowTable = t;

            TransactionFactory = new DatabaseTransactionFactory(this);
        }
Exemplo n.º 2
0
        internal Database(DatabaseSystem system, IDatabaseContext context)
        {
            System  = system;
            Context = context;

            Name = Context.DatabaseName();

            DiscoverDataVersion();

            TableComposite = new TableSourceComposite(this);

            Context.RegisterInstance(this);
            Context.RegisterInstance <ITableSourceComposite>(TableComposite);

            Locker = new Locker(this);

            Sessions = new ActiveSessionList(this);

            // Create the single row table
            var t = new TemporaryTable(context, "SINGLE_ROW_TABLE", new ColumnInfo[0]);

            t.NewRow();
            SingleRowTable = t;

            TransactionFactory = new DatabaseTransactionFactory(this);
        }
Exemplo n.º 3
0
        private void AddRow(TemporaryTable tmpTable, long id, string name, DateTimeOffset date)
        {
            var row = new Field[3];

            row[0] = Field.BigInt(id);
            row[1] = Field.String(name);
            row[2] = Field.Date(date);
            tmpTable.NewRow(row);
        }
Exemplo n.º 4
0
        private void ReadAll()
        {
            if (Result.Type == StatementResultType.CursorRef)
            {
                var tableInfo = Result.Cursor.Source.TableInfo;
                localTable = new TemporaryTable("##LOCAL##", tableInfo);

                foreach (var row in Result.Cursor)
                {
                    var rowIndex = localTable.NewRow();
                    for (int i = 0; i < row.ColumnCount; i++)
                    {
                        localTable.SetValue(rowIndex, i, row.GetValue(i));
                    }
                }
            }
        }
Exemplo n.º 5
0
 private void AddRow(TemporaryTable tmpTable, long id, string name, DateTimeOffset date)
 {
     var row = new Field[3];
     row[0] = Field.BigInt(id);
     row[1] = Field.String(name);
     row[2] = Field.Date(date);
     tmpTable.NewRow(row);
 }