Skip to content

Commit 76512b5

Browse files
committed
Move to scalardb-dotnet-samples
1 parent 636f1b1 commit 76512b5

File tree

12 files changed

+24
-23
lines changed

12 files changed

+24
-23
lines changed

dotnet/scalardb-cluster-sample/Commands/LoadInitialDataCommand.cs renamed to scalardb-dotnet-samples/scalardb-cluster-sample/Commands/LoadInitialDataCommand.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public static Command Create()
2222
try
2323
{
2424
await sample.LoadInitialData();
25+
return;
2526
}
2627
catch (IllegalArgumentException)
2728
{

dotnet/scalardb-cluster-sample/Sample.cs renamed to scalardb-dotnet-samples/scalardb-cluster-sample/Sample.cs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,39 +29,39 @@ public Sample()
2929
public async Task CreateTables()
3030
{
3131
using var admin = _factory.GetTransactionAdmin();
32-
33-
var customersTableMetadata
34-
= new TableMetadataBuilder()
35-
.AddPartitionKey("customer_id", DataType.Int)
36-
.AddColumn("name", DataType.Text)
37-
.AddColumn("credit_limit", DataType.Int)
38-
.AddColumn("credit_total", DataType.Int)
39-
.Build();
40-
41-
var ordersTableMetadata
42-
= new TableMetadataBuilder()
43-
.AddSecondaryIndex("order_id", DataType.Text)
44-
.AddPartitionKey("customer_id", DataType.Int)
45-
.AddClusteringKey("timestamp", DataType.Bigint)
46-
.Build();
47-
48-
var statementsTableMetadata
49-
= new TableMetadataBuilder()
32+
33+
var customersTableMetadata =
34+
new TableMetadataBuilder()
35+
.AddPartitionKey("customer_id", DataType.Int)
36+
.AddColumn("name", DataType.Text)
37+
.AddColumn("credit_limit", DataType.Int)
38+
.AddColumn("credit_total", DataType.Int)
39+
.Build();
40+
41+
var ordersTableMetadata =
42+
new TableMetadataBuilder()
43+
.AddSecondaryIndex("order_id", DataType.Text)
44+
.AddPartitionKey("customer_id", DataType.Int)
45+
.AddClusteringKey("timestamp", DataType.Bigint)
46+
.Build();
47+
48+
var statementsTableMetadata =
49+
new TableMetadataBuilder()
5050
.AddPartitionKey("order_id", DataType.Text)
5151
.AddClusteringKey("item_id", DataType.Int)
5252
.AddColumn("count", DataType.Int)
5353
.Build();
54-
55-
var itemsTableMetadata
56-
= new TableMetadataBuilder()
54+
55+
var itemsTableMetadata =
56+
new TableMetadataBuilder()
5757
.AddPartitionKey("item_id", DataType.Int)
5858
.AddColumn("name", DataType.Text)
5959
.AddColumn("price", DataType.Int)
6060
.Build();
61-
61+
6262
await admin.CreateCoordinatorTablesAsync(true);
6363
await admin.CreateNamespaceAsync("sample", true);
64-
64+
6565
await admin.CreateTableAsync("sample", "customers", customersTableMetadata, true);
6666
await admin.CreateTableAsync("sample", "orders", ordersTableMetadata, true);
6767
await admin.CreateTableAsync("sample", "statements", statementsTableMetadata, true);

0 commit comments

Comments
 (0)