Sha256: aa7e923e93c387e06a9d9cd2bd6e8d54bc60b5a3a7d7ac0bf99238d6b0517ea5
Contents?: true
Size: 1022 Bytes
Versions: 26
Compression:
Stored size: 1022 Bytes
Contents
module Superstore module Adapters class AbstractAdapter attr_reader :config def initialize(config) @config = config end # Read records from a instance of Superstore::Scope def select(scope) # abstract end # Insert a new row def insert(table, id, attributes) # abstract end # Update an existing row def update(table, id, attributes) # abstract end # Delete rows by an array of ids def delete(table, ids) # abstract end def execute_batch(statements) # abstract end def batching? !@batch_statements.nil? end def batch @batch_statements = [] yield execute_batch(@batch_statements) if @batch_statements.any? ensure @batch_statements = nil end def execute_batchable(statement) if @batch_statements @batch_statements << statement else execute statement end end end end end
Version data entries
26 entries across 26 versions & 1 rubygems