|
|
@@ -64,6 +64,11 @@ service DatabaseService {
|
|
|
rpc ListViews(ListViewsRequest) returns (ListViewsResponse);
|
|
|
rpc GetViewInfo(GetViewInfoRequest) returns (GetViewInfoResponse);
|
|
|
|
|
|
+ // Collection configuration
|
|
|
+ rpc ConfigureCollection(ConfigureCollectionRequest) returns (ConfigureCollectionResponse);
|
|
|
+ rpc GetCollectionConfig(GetCollectionConfigRequest) returns (GetCollectionConfigResponse);
|
|
|
+ rpc MigrateCollectionTimestamps(MigrateCollectionTimestampsRequest) returns (MigrateCollectionTimestampsResponse);
|
|
|
+
|
|
|
// File operations
|
|
|
rpc UploadFile(stream FileChunk) returns (UploadFileResponse);
|
|
|
rpc DownloadFile(DownloadFileRequest) returns (stream FileChunk);
|
|
|
@@ -738,3 +743,46 @@ message GetViewInfoResponse {
|
|
|
ViewDefinition view = 1;
|
|
|
bool found = 2;
|
|
|
}
|
|
|
+
|
|
|
+// ===== Collection Configuration =====
|
|
|
+
|
|
|
+// Per-collection configuration for timestamp precision and other runtime knobs.
|
|
|
+// Stored in the _collection_meta system collection.
|
|
|
+message CollectionConfig {
|
|
|
+ // "ms" (default) — _created_at/_updated_at stamped in milliseconds since epoch
|
|
|
+ // "ns" — _created_at/_updated_at stamped in nanoseconds since epoch
|
|
|
+ string timestamp_precision = 1;
|
|
|
+ // Room for future per-collection knobs
|
|
|
+}
|
|
|
+
|
|
|
+message ConfigureCollectionRequest {
|
|
|
+ string collection = 1;
|
|
|
+ CollectionConfig config = 2;
|
|
|
+}
|
|
|
+
|
|
|
+message ConfigureCollectionResponse {
|
|
|
+ bool success = 1;
|
|
|
+ string error = 2;
|
|
|
+}
|
|
|
+
|
|
|
+message GetCollectionConfigRequest {
|
|
|
+ string collection = 1;
|
|
|
+}
|
|
|
+
|
|
|
+message GetCollectionConfigResponse {
|
|
|
+ CollectionConfig config = 1;
|
|
|
+ bool found = 2;
|
|
|
+}
|
|
|
+
|
|
|
+message MigrateCollectionTimestampsRequest {
|
|
|
+ string collection = 1;
|
|
|
+ string from_precision = 2; // "ms" or "ns"
|
|
|
+ string to_precision = 3; // "ms" or "ns"
|
|
|
+}
|
|
|
+
|
|
|
+message MigrateCollectionTimestampsResponse {
|
|
|
+ bool success = 1;
|
|
|
+ string error = 2;
|
|
|
+ uint64 rows_migrated = 3; // how many documents had their timestamps updated
|
|
|
+ uint64 rows_skipped = 4; // already in target range (idempotent resume)
|
|
|
+}
|