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

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
naomijub committed May 1, 2023
1 parent 1b8fdcb commit 84ce4df
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions kreya/grpc/com/xtdb/protos/GrpcApi/SubmitTx-request.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
"txOps": [
{
"put": {
"xtId": "id1",
"document": "Via Security"
}
},
{
"put": {
"xtId": "id2",
"document": "Rustic Plastic Sausages Graphic Interface incubate"
}
}
Expand Down
1 change: 1 addition & 0 deletions resources/service.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
syntax = "proto3";

package com.xtdb.protos;

import "transactions.proto";

message Empty { }
Expand Down
11 changes: 11 additions & 0 deletions src/gxtdb/adapters/tx_log.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(ns gxtdb.adapters.tx-log
(:require [gxtdb.utils :as utils]))

(defn ->tx-log [ops]
(let [transaction (-> ops :transaction-type)
transaction-type (-> transaction keys first)]
(println (str "---" "\n" transaction-type "\n" transaction "\n\n\n"))))

(defn proto->tx-log [tx-ops]
(println (str "ARROZ" "\n\n\n" tx-ops "\n\n"))
(mapv ->tx-log tx-ops))
4 changes: 3 additions & 1 deletion src/gxtdb/service.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[ring.util.response :as ring-resp]

[gxtdb.adapters.status :as status-adapter]
[gxtdb.adapters.tx-log :as tx-log-adapter]

;; -- XTDB --
[xtdb.api :as xt]
Expand Down Expand Up @@ -43,7 +44,8 @@

(deftype GrpcAPI [xtdb-node]
api/Service
(SubmitTx [_this _request]
(SubmitTx [_this {{:keys [tx-ops]} :grpc-params}]
(let [tx-log (tx-log-adapter/proto->tx-log tx-ops)])
{:status 200
:body {:tx-time "time" :tx-id 3}})
(Status
Expand Down

0 comments on commit 84ce4df

Please sign in to comment.