-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
30 lines (24 loc) · 812 Bytes
/
Program.cs
File metadata and controls
30 lines (24 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using CSharpDatabase.indexes;
using CSharpDatabase.Serializations;
using CSharpDatabase.Storages;
using CSharpDatabase.Stores;
using Microsoft.Extensions.Configuration;
var config = new ConfigurationBuilder()
.AddJsonFile("appsettings.json")
.Build();
var storage = StorageMultiplexer.FromConfig(config);
var codec = new PageCodec(new JsonPageSerializer(), new GzipCompressor());
var index = new IndexManager<object>();
var appender = new RowGroupAppender<object>("users", storage, codec, index);
await appender.AppendAsync(RowRecord<object>.From(
("name", "Raymond"),
("age", 28),
("score", 95.5)
));
await appender.AppendAsync(RowRecord<object>.From(
("name", "Alex"),
("age", 33),
("score", 87.0)
));
// 建議最後 flush 所有欄位
await appender.FlushAllAsync();