Class: Remi::Encoder::Postgres
- Inherits:
-
Remi::Encoder
- Object
- Remi::Encoder
- Remi::Encoder::Postgres
- Defined in:
- lib/remi/data_subjects/postgres.rb
Overview
Postgres encoder
Instance Attribute Summary collapse
-
#values ⇒ Array<String>
All records of the dataframe encoded as strings to be used by Postgres Bulk updater.
Attributes inherited from Remi::Encoder
#context, #field_symbolizer, #fields, #logger
Instance Method Summary collapse
-
#ddl_fields ⇒ String
Field definitions to be used in the DDL.
-
#encode(dataframe) ⇒ Object
Converts the dataframe to an array of hashes, which can be used by the postgres loader.
Methods inherited from Remi::Encoder
Constructor Details
This class inherits a constructor from Remi::Encoder
Instance Attribute Details
#values ⇒ Array<String>
Returns All records of the dataframe encoded as strings to be used by Postgres Bulk updater.
109 110 111 |
# File 'lib/remi/data_subjects/postgres.rb', line 109 def values @values end |
Instance Method Details
#ddl_fields ⇒ String
Returns Field definitions to be used in the DDL.
122 123 124 |
# File 'lib/remi/data_subjects/postgres.rb', line 122 def ddl_fields fields.map { |k,v| "#{k} #{v[:type]}" }.join(', ') end |
#encode(dataframe) ⇒ Object
Converts the dataframe to an array of hashes, which can be used by the postgres loader.
116 117 118 119 |
# File 'lib/remi/data_subjects/postgres.rb', line 116 def encode(dataframe) @values = encode_data(dataframe) self end |