Class: Google::Apis::SqladminV1::ImportContext::CsvImportOptions

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/sqladmin_v1/classes.rb,
lib/google/apis/sqladmin_v1/representations.rb,
lib/google/apis/sqladmin_v1/representations.rb

Overview

Options for importing data as CSV.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ CsvImportOptions

Returns a new instance of CsvImportOptions.



1822
1823
1824
# File 'lib/google/apis/sqladmin_v1/classes.rb', line 1822

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#columnsArray<String>

The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. Corresponds to the JSON property columns

Returns:

  • (Array<String>)


1792
1793
1794
# File 'lib/google/apis/sqladmin_v1/classes.rb', line 1792

def columns
  @columns
end

#escape_characterString

Specifies the character that should appear before a data character that needs to be escaped. Corresponds to the JSON property escapeCharacter

Returns:

  • (String)


1798
1799
1800
# File 'lib/google/apis/sqladmin_v1/classes.rb', line 1798

def escape_character
  @escape_character
end

#fields_terminated_byString

Specifies the character that separates columns within each row (line) of the file. Corresponds to the JSON property fieldsTerminatedBy

Returns:

  • (String)


1804
1805
1806
# File 'lib/google/apis/sqladmin_v1/classes.rb', line 1804

def fields_terminated_by
  @fields_terminated_by
end

#lines_terminated_byString

This is used to separate lines. If a line does not contain all fields, the rest of the columns are set to their default values. Corresponds to the JSON property linesTerminatedBy

Returns:

  • (String)


1810
1811
1812
# File 'lib/google/apis/sqladmin_v1/classes.rb', line 1810

def lines_terminated_by
  @lines_terminated_by
end

#quote_characterString

Specifies the quoting character to be used when a data value is quoted. Corresponds to the JSON property quoteCharacter

Returns:

  • (String)


1815
1816
1817
# File 'lib/google/apis/sqladmin_v1/classes.rb', line 1815

def quote_character
  @quote_character
end

#tableString

The table to which CSV data is imported. Corresponds to the JSON property table

Returns:

  • (String)


1820
1821
1822
# File 'lib/google/apis/sqladmin_v1/classes.rb', line 1820

def table
  @table
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1827
1828
1829
1830
1831
1832
1833
1834
# File 'lib/google/apis/sqladmin_v1/classes.rb', line 1827

def update!(**args)
  @columns = args[:columns] if args.key?(:columns)
  @escape_character = args[:escape_character] if args.key?(:escape_character)
  @fields_terminated_by = args[:fields_terminated_by] if args.key?(:fields_terminated_by)
  @lines_terminated_by = args[:lines_terminated_by] if args.key?(:lines_terminated_by)
  @quote_character = args[:quote_character] if args.key?(:quote_character)
  @table = args[:table] if args.key?(:table)
end