lib/dynamoid/adapter_plugin/aws_sdk_v2.rb
def truncate(table_name)
        table = describe_table(table_name)
        hk    = table.hash_key
        rk    = table.range_key

        scan(table_name, {}, {}).each do |attributes|
          opts = {range_key: attributes[rk.to_sym] } if rk
          delete_item(table_name, attributes[hk], opts)
        end
      end
#
# Truncates all records in the given table
#
# @param [String] table_name the name of the table
#
# @since 1.0.0
Truncates all records in the given table
Truncates all records in the given table
def truncate(table_name)
        table = describe_table(table_name)
        hk    = table.hash_key
        rk    = table.range_key
        scan(table_name, {}, {}).each do |attributes|
          opts = {range_key: attributes[rk.to_sym] } if rk
          delete_item(table_name, attributes[hk], opts)
        end
      end
def truncate ( table_name ) table = describe_table ( table_name ) hk = table . hash_key rk = table . range_key scan ( table_name , { } , { } ) . each do | attributes | opts = { range_key : attributes [ rk . to_sym ] } if rk delete_item ( table_name , attributes [ hk ] , opts ) end end
Truncates all records in the given table
Truncates all records in the given table
table_name
table_name the name of the table
table_name the name of the table
since
None