예제 #1
0
    private async Task InitializeDatabaseAsync()
    {
        // If the database has not been initialized, retry.
        CreateDatabaseAsyncSample  createDatabaseAsyncSample  = new CreateDatabaseAsyncSample();
        InsertDataAsyncSample      insertDataAsyncSample      = new InsertDataAsyncSample();
        AddColumnAsyncSample       addColumnAsyncSample       = new AddColumnAsyncSample();
        AddIndexAsyncSample        addIndexAsyncSample        = new AddIndexAsyncSample();
        AddStoringIndexAsyncSample addStoringIndexAsyncSample = new AddStoringIndexAsyncSample();
        await createDatabaseAsyncSample.CreateDatabaseAsync(ProjectId, InstanceId, DatabaseId);

        await insertDataAsyncSample.InsertDataAsync(ProjectId, InstanceId, DatabaseId);

        await InsertStructDataAsync();

        await addColumnAsyncSample.AddColumnAsync(ProjectId, InstanceId, DatabaseId);

        await AddCommitTimestampAsync();

        await addIndexAsyncSample.AddIndexAsync(ProjectId, InstanceId, DatabaseId);

        // Add storing Index on table.
        await addStoringIndexAsyncSample.AddStoringIndexAsync(ProjectId, InstanceId, DatabaseId);

        // Update the value of MarketingBudgets.
        await RefillMarketingBudgetsAsync(300000, 300000);
    }
예제 #2
0
    private async Task InitializeDatabaseAsync()
    {
        // If the database has not been initialized, retry.
        CreateDatabaseAsyncSample         createDatabaseAsyncSample                         = new CreateDatabaseAsyncSample();
        InsertDataAsyncSample             insertDataAsyncSample                             = new InsertDataAsyncSample();
        InsertStructSampleDataAsyncSample insertStructSampleDataAsyncSample                 = new InsertStructSampleDataAsyncSample();
        AddColumnAsyncSample                      addColumnAsyncSample                      = new AddColumnAsyncSample();
        AddCommitTimestampAsyncSample             addCommitTimestampAsyncSample             = new AddCommitTimestampAsyncSample();
        AddIndexAsyncSample                       addIndexAsyncSample                       = new AddIndexAsyncSample();
        AddStoringIndexAsyncSample                addStoringIndexAsyncSample                = new AddStoringIndexAsyncSample();
        CreateTableWithDataTypesAsyncSample       createTableWithDataTypesAsyncSample       = new CreateTableWithDataTypesAsyncSample();
        InsertDataTypesDataAsyncSample            insertDataTypesDataAsyncSample            = new InsertDataTypesDataAsyncSample();
        CreateTableWithTimestampColumnAsyncSample createTableWithTimestampColumnAsyncSample =
            new CreateTableWithTimestampColumnAsyncSample();
        await createDatabaseAsyncSample.CreateDatabaseAsync(ProjectId, InstanceId, DatabaseId);

        await insertDataAsyncSample.InsertDataAsync(ProjectId, InstanceId, DatabaseId);

        await insertStructSampleDataAsyncSample.InsertStructSampleDataAsync(ProjectId, InstanceId, DatabaseId);

        await addColumnAsyncSample.AddColumnAsync(ProjectId, InstanceId, DatabaseId);

        await addCommitTimestampAsyncSample.AddCommitTimestampAsync(ProjectId, InstanceId, DatabaseId);

        await addIndexAsyncSample.AddIndexAsync(ProjectId, InstanceId, DatabaseId);

        // Create a new table that includes supported datatypes.
        await createTableWithDataTypesAsyncSample.CreateTableWithDataTypesAsync(ProjectId, InstanceId, DatabaseId);

        // Write data to the new table.
        await insertDataTypesDataAsyncSample.InsertDataTypesDataAsync(ProjectId, InstanceId, DatabaseId);

        // Add storing Index on table.
        await addStoringIndexAsyncSample.AddStoringIndexAsync(ProjectId, InstanceId, DatabaseId);

        // Update the value of MarketingBudgets.
        await RefillMarketingBudgetsAsync(300000, 300000);

        // Create table with Timestamp column
        await createTableWithTimestampColumnAsyncSample.CreateTableWithTimestampColumnAsync(ProjectId, InstanceId, DatabaseId);
    }