Sha256: 36af39473d23e1be5c00b130c3f7fb39c5a33225699b53f44ae902921a53e405
Contents?: true
Size: 780 Bytes
Versions: 9
Compression:
Stored size: 780 Bytes
Contents
require_relative '_shared' require 'cassanity' client = Cassanity::Client.new('127.0.0.1:9160', { instrumenter: ActiveSupport::Notifications, }) keyspace = client['cassanity_examples'] keyspace.recreate # setting up the apps column family apps = keyspace.column_family('apps', { schema: { primary_key: :id, columns: { id: :text, name: :text, }, }, }) apps.create # batch several operations in one network call client.batch({ keyspace_name: keyspace.name, column_family_name: apps.name, modifications: [ [:insert, data: {id: '1', name: 'github'}], [:insert, data: {id: '2', name: 'gist'}], [:update, set: {name: 'github.com'}, where: {id: '1'}], [:delete, where: {id: '2'}], ], }) # only github.com is left pp apps.select
Version data entries
9 entries across 9 versions & 1 rubygems