Class: Tablature::PartitionedTable

Inherits:
Object
  • Object
show all
Defined in:
lib/tablature/partitioned_table.rb

Overview

The in-memory representation of a partitioned table definition.

This object is used internally by adapters and the schema dumper and is not intended to be used by application code. It is documented here for use by adapter gems.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, partitioning_method:, partitions: [], partition_key:) ⇒ PartitionedTable

Returns a new instance of PartitionTable.

Parameters:

  • name (String)

    The name of the view.

  • partitioning_method (:symbol)

    One of :range, :list or :hash

  • partitions (Array) (defaults to: [])

    The partitions of the table.

  • partition_key (String)

    The partition key expression.



32
33
34
35
36
37
# File 'lib/tablature/partitioned_table.rb', line 32

def initialize(name:, partitioning_method:, partitions: [], partition_key:)
  @name = name
  @partitioning_method = partitioning_method
  @partitions = partitions
  @partition_key = partition_key
end

Instance Attribute Details

#nameString (readonly)

The name of the partitioned table

Returns:

  • (String)


12
13
14
# File 'lib/tablature/partitioned_table.rb', line 12

def name
  @name
end

#partition_keyString (readonly)

The partition key expression.

Returns:

  • (String)


24
25
26
# File 'lib/tablature/partitioned_table.rb', line 24

def partition_key
  @partition_key
end

#partitioning_methodSymbol (readonly)

The partitioning method of the table

Returns:

  • (Symbol)


16
17
18
# File 'lib/tablature/partitioned_table.rb', line 16

def partitioning_method
  @partitioning_method
end

#partitionsArray (readonly)

The partitions of the table.

Returns:

  • (Array)


20
21
22
# File 'lib/tablature/partitioned_table.rb', line 20

def partitions
  @partitions
end