Class: Mysql2postgres::PostgresDbWriter
- Inherits:
-
PostgresFileWriter
- Object
- PostgresWriter
- PostgresFileWriter
- Mysql2postgres::PostgresDbWriter
- Defined in:
- lib/mysql2postgres/postgres_db_writer.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Attributes inherited from PostgresWriter
Instance Method Summary collapse
- #clear_schema ⇒ Object
-
#initialize(file, destination) ⇒ PostgresDbWriter
constructor
A new instance of PostgresDbWriter.
- #inload(path = filename) ⇒ Object
Methods inherited from PostgresFileWriter
#close, #truncate, #write_constraints, #write_contents, #write_indexes, #write_table
Methods inherited from PostgresWriter
#column_description, #column_type, #column_type_info, #process_row, #truncate
Constructor Details
#initialize(file, destination) ⇒ PostgresDbWriter
Returns a new instance of PostgresDbWriter.
10 11 12 13 14 15 |
# File 'lib/mysql2postgres/postgres_db_writer.rb', line 10 def initialize(file, destination) # NOTE: the superclass opens and truncates filename for writing super @connection = Connection.new destination end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
8 9 10 |
# File 'lib/mysql2postgres/postgres_db_writer.rb', line 8 def connection @connection end |
Instance Method Details
#clear_schema ⇒ Object
21 22 23 |
# File 'lib/mysql2postgres/postgres_db_writer.rb', line 21 def clear_schema connection.clear_schema end |
#inload(path = filename) ⇒ Object
17 18 19 |
# File 'lib/mysql2postgres/postgres_db_writer.rb', line 17 def inload(path = filename) connection.load_file path end |