Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Database"/> class providing
        /// a given parent <see cref="IDatabaseContext"/>.
        /// </summary>
        /// <param name="context">The database context that provides the required
        /// configurations and services to the database.</param>
        public Database(IDatabaseContext context)
        {
            DatabaseContext = context;

            DiscoverDataVersion();

            TableComposite = new TableSourceComposite(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);
        }
Beispiel #2
0
 private void AddRow(TemporaryTable tmpTable, long id, string name, DateTimeOffset date)
 {
     var row = new DataObject[3];
     row[0] = DataObject.BigInt(id);
     row[1] = DataObject.String(name);
     row[2] = DataObject.Date(date);
     tmpTable.NewRow(row);
 }