0
0
mirror of https://github.com/tursodatabase/libsql.git synced 2024-12-15 07:29:41 +00:00
libsql/libsql-storage/proto/storage.proto
2024-07-31 20:27:55 +05:30

89 lines
1.6 KiB
Protocol Buffer

syntax = "proto3";
package storage;
message Frame {
uint32 page_no = 1;
bytes data = 2;
}
message InsertFramesRequest {
string namespace = 1;
repeated Frame frames = 2;
uint64 max_frame_no = 3;
}
message InsertFramesResponse {
uint32 num_frames = 1;
}
message FindFrameRequest {
string namespace = 1;
uint32 page_no = 2;
uint64 max_frame_no = 3;
}
message FindFrameResponse {
optional uint64 frame_no = 1;
}
message ReadFrameRequest {
string namespace = 1;
uint64 frame_no = 2;
}
message ReadFrameResponse {
optional bytes frame = 1;
}
message DbSizeRequest {
string namespace = 1;
}
message DbSizeResponse {
uint64 size = 1;
}
message FramesInWALRequest {
string namespace = 1;
}
message FramesInWALResponse {
uint64 count = 1;
}
message FramePageNumRequest {
string namespace = 1;
uint64 frame_no = 2;
}
message FramePageNumResponse {
uint32 page_no = 1;
}
message DestroyRequest {
string namespace = 1;
}
message DestroyResponse {}
enum ErrorCode {
INTERNAL_ERROR = 0;
WRITE_CONFLICT = 1;
}
message ErrorDetails {
ErrorCode code = 1;
string message = 2;
}
service Storage {
rpc InsertFrames(InsertFramesRequest) returns (InsertFramesResponse) {}
rpc FindFrame(FindFrameRequest) returns (FindFrameResponse) {}
rpc ReadFrame(ReadFrameRequest) returns (ReadFrameResponse) {}
rpc DbSize(DbSizeRequest) returns (DbSizeResponse) {}
rpc FramesInWAL(FramesInWALRequest) returns (FramesInWALResponse) {}
rpc FramePageNum(FramePageNumRequest) returns (FramePageNumResponse) {}
rpc Destroy(DestroyRequest) returns (DestroyResponse) {}
}