Class: DataTaster::FileOutput

Inherits:
Output
  • Object
show all
Defined in:
lib/data_taster/adapters/file_output.rb,
sig/data_taster.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Output

#export_mode, #initialize

Constructor Details

This class inherits a constructor from DataTaster::Output

Instance Attribute Details

#pathString (readonly)

Returns the value of attribute path.

Returns:

  • (String)


5
6
7
# File 'lib/data_taster/adapters/file_output.rb', line 5

def path
  @path
end

#target_databaseString (readonly)

Returns the value of attribute target_database.

Returns:

  • (String)


5
6
7
# File 'lib/data_taster/adapters/file_output.rb', line 5

def target_database
  @target_database
end

Instance Method Details

#default_dataObject



14
15
16
# File 'lib/data_taster/adapters/file_output.rb', line 14

def default_data
  {}
end

#qualified_table_name(table_name) ⇒ Object



22
23
24
# File 'lib/data_taster/adapters/file_output.rb', line 22

def qualified_table_name(table_name)
  DataTaster::ExportContext.quote_ident(table_name)
end

#run_sanitization?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/data_taster/adapters/file_output.rb', line 18

def run_sanitization?
  false
end

#sample!Object



7
8
9
10
11
12
# File 'lib/data_taster/adapters/file_output.rb', line 7

def sample!
  start_export
  process_export
ensure
  finish_export
end

#write_raw(line) ⇒ Object



30
31
32
# File 'lib/data_taster/adapters/file_output.rb', line 30

def write_raw(line)
  @io.puts line
end

#write_statement(sql) ⇒ Object



26
27
28
# File 'lib/data_taster/adapters/file_output.rb', line 26

def write_statement(sql)
  @io.puts "#{sql};"
end