Skip to content
This repository has been archived by the owner on Dec 7, 2024. It is now read-only.

Commit

Permalink
implements submit-tx with put/delete/evict
Browse files Browse the repository at this point in the history
  • Loading branch information
naomijub committed May 20, 2023
1 parent 8db5380 commit 4b11d31
Show file tree
Hide file tree
Showing 17 changed files with 1,114 additions and 146 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ kibit:
lint: fmt kibit

proto:
protoc --clojure_out=grpc-client,grpc-server:src --proto_path=resources resources/service.proto
protoc --clojure_out=grpc-client,grpc-server:src --proto_path=resources resources/transactions.proto resources/service.proto

all: proto lint

Expand Down
9 changes: 2 additions & 7 deletions kreya/grpc/com/xtdb/protos/GrpcApi/SubmitTx-request.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@
{
"put": {
"xtId": "id1",
"document": "Via Security"
}
},
{
"put": {
"xtId": "id2",
"document": "Rustic Plastic Sausages Graphic Interface incubate"
"idType":"Keyword",
"document": {"key": "value"}
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
:plugins [[lein-cljfmt "0.9.2"]
[lein-kibit "0.1.8"]
[jonase/eastwood "1.4.0"]]
:dependencies [[org.clojure/clojure "1.10.3"]
:dependencies [[org.clojure/clojure "1.11.0"]
[com.xtdb/xtdb-core "1.22.1"]
[io.pedestal/pedestal.service "0.5.9"]
[com.cognitect/anomalies "0.1.12"]
Expand Down
95 changes: 0 additions & 95 deletions resources/json.proto

This file was deleted.

17 changes: 14 additions & 3 deletions resources/transactions.proto
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
syntax = "proto3";

package com.xtdb.protos;
import "json.proto";
import "google/protobuf/struct.proto";


message Transaction {
oneof transaction_type {
Expand All @@ -11,17 +12,27 @@ message Transaction {
}
}

enum IdType {
Uuid = 0;
Keyword = 1;
String = 2;
Int = 3;
}

message Put {
string xt_id = 1;
com.xtdb.protos.Value document = 2;
IdType id_type = 1;
string xt_id = 2;
google.protobuf.Struct document = 3;
}

message Delete {
string document_id = 1;
IdType id_type = 2;
}

message Evict {
string document_id = 1;
IdType id_type = 2;
}

message SubmitRequest {
Expand Down
Loading

0 comments on commit 4b11d31

Please sign in to comment.