Module: Rxer::Api::V1::Transactions

Defined in:
lib/rxer/api/v1/transactions.rb

Overview

Working with Transactions

Instance Method Summary collapse

Instance Method Details

#commit_tx(db_name:, tx_id:) ⇒ Object



12
13
14
# File 'lib/rxer/api/v1/transactions.rb', line 12

def commit_tx(db_name:, tx_id:)
  post(endpoint: "/api/v1/db/#{db_name}/transactions/#{tx_id}/commit", payload: {})
end

#create_items_tx(db_name:, tx_id:, payload:) ⇒ Object



20
21
22
# File 'lib/rxer/api/v1/transactions.rb', line 20

def create_items_tx(db_name:, tx_id:, payload:)
  post(endpoint: "/api/v1/db/#{db_name}/transactions/#{tx_id}/items", payload: payload)
end

#create_tx(db_name:, ns_name:) ⇒ Object



8
9
10
# File 'lib/rxer/api/v1/transactions.rb', line 8

def create_tx(db_name:, ns_name:)
  post(endpoint: "/api/v1/db/#{db_name}/namespaces/#{ns_name}/transactions/begin", payload: {})
end

#drop_items_tx(db_name:, tx_id:, payload:) ⇒ Object



32
33
34
# File 'lib/rxer/api/v1/transactions.rb', line 32

def drop_items_tx(db_name:, tx_id:, payload:)
  delete(endpoint: "/api/v1/db/#{db_name}/transactions/#{tx_id}/items", payload: payload)
end

#rollback_tx(db_name:, tx_id:) ⇒ Object



16
17
18
# File 'lib/rxer/api/v1/transactions.rb', line 16

def rollback_tx(db_name:, tx_id:)
  post(endpoint: "/api/v1/db/#{db_name}/transactions/#{tx_id}/rollback", payload: {})
end

#update_items_tx(db_name:, tx_id:, payload:) ⇒ Object



28
29
30
# File 'lib/rxer/api/v1/transactions.rb', line 28

def update_items_tx(db_name:, tx_id:, payload:)
  put(endpoint: "/api/v1/db/#{db_name}/transactions/#{tx_id}/items", payload: payload)
end

#upsert_items_tx(db_name:, tx_id:, payload:) ⇒ Object



24
25
26
# File 'lib/rxer/api/v1/transactions.rb', line 24

def upsert_items_tx(db_name:, tx_id:, payload:)
  patch(endpoint: "/api/v1/db/#{db_name}/transactions/#{tx_id}/items", payload: payload)
end