Google Cloud Sql Admin V1beta4 Client - Class ImportContext (0.11.0)

Reference documentation and code samples for the Google Cloud Sql Admin V1beta4 Client class ImportContext.

Database instance import context.

Generated from protobuf message google.cloud.sql.v1beta4.ImportContext

Namespace

Google \ Cloud \ Sql \ V1beta4

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ uri string

Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file.

↳ database string

The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified.

↳ kind string

This is always sql#importContext.

↳ file_type int

The file type for the specified uri. * SQL: The file contains SQL statements. * CSV: The file contains CSV data. * BAK: The file contains backup data for a SQL Server instance.

↳ csv_import_options Google\Cloud\Sql\V1beta4\ImportContext\SqlCsvImportOptions

Options for importing data as CSV.

↳ import_user string

The PostgreSQL user for this import operation. PostgreSQL instances only.

↳ bak_import_options Google\Cloud\Sql\V1beta4\ImportContext\SqlBakImportOptions

Import parameters specific to SQL Server .BAK files

getUri

Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file.

Returns
TypeDescription
string

setUri

Path to the import file in Cloud Storage, in the form gs://bucketName/fileName. Compressed gzip files (.gz) are supported when fileType is SQL. The instance must have write permissions to the bucket and read access to the file.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getDatabase

The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified.

Returns
TypeDescription
string

setDatabase

The target database for the import. If fileType is SQL, this field is required only if the import file does not specify a database, and is overridden by any database specification in the import file. If fileType is CSV, one database must be specified.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getKind

This is always sql#importContext.

Returns
TypeDescription
string

setKind

This is always sql#importContext.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getFileType

The file type for the specified uri.

  • SQL: The file contains SQL statements.
  • CSV: The file contains CSV data.
  • BAK: The file contains backup data for a SQL Server instance.
Returns
TypeDescription
int

setFileType

The file type for the specified uri.

  • SQL: The file contains SQL statements.
  • CSV: The file contains CSV data.
  • BAK: The file contains backup data for a SQL Server instance.
Parameter
NameDescription
var int
Returns
TypeDescription
$this

getCsvImportOptions

Options for importing data as CSV.

Returns
TypeDescription
Google\Cloud\Sql\V1beta4\ImportContext\SqlCsvImportOptions|null

hasCsvImportOptions

clearCsvImportOptions

setCsvImportOptions

Options for importing data as CSV.

Parameter
NameDescription
var Google\Cloud\Sql\V1beta4\ImportContext\SqlCsvImportOptions
Returns
TypeDescription
$this

getImportUser

The PostgreSQL user for this import operation. PostgreSQL instances only.

Returns
TypeDescription
string

setImportUser

The PostgreSQL user for this import operation. PostgreSQL instances only.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getBakImportOptions

Import parameters specific to SQL Server .BAK files

Returns
TypeDescription
Google\Cloud\Sql\V1beta4\ImportContext\SqlBakImportOptions|null

hasBakImportOptions

clearBakImportOptions

setBakImportOptions

Import parameters specific to SQL Server .BAK files

Parameter
NameDescription
var Google\Cloud\Sql\V1beta4\ImportContext\SqlBakImportOptions
Returns
TypeDescription
$this