Reference documentation and code samples for the Google Cloud Sql Admin V1 Client class ImportContext.
Database instance import context.
Generated from protobuf messagegoogle.cloud.sql.v1.ImportContext
Namespace
Google \ Cloud \ Sql \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ uri
string
Path to the import file in Cloud Storage, in the formgs://bucketName/fileName. Compressed gzip files (.gz) are supported whenfileTypeisSQL. The instance must have write permissions to the bucket and read access to the file.
↳ database
string
The target database for the import. IffileTypeisSQL, 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. IffileTypeisCSV, one database must be specified.
↳ kind
string
This is alwayssql#importContext.
↳ file_type
int
The file type for the specified uri.`SQL: The file contains SQL statements. \CSV`: The file contains CSV data.
Optional. Options for importing data from SQL statements.
getUri
Path to the import file in Cloud Storage, in the formgs://bucketName/fileName. Compressed gzip files (.gz) are supported
whenfileTypeisSQL. The instance must have
write permissions to the bucket and read access to the file.
Returns
Type
Description
string
setUri
Path to the import file in Cloud Storage, in the formgs://bucketName/fileName. Compressed gzip files (.gz) are supported
whenfileTypeisSQL. The instance must have
write permissions to the bucket and read access to the file.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getDatabase
The target database for the import. IffileTypeisSQL, 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. IffileTypeisCSV, one database must be specified.
Returns
Type
Description
string
setDatabase
The target database for the import. IffileTypeisSQL, 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. IffileTypeisCSV, one database must be specified.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getKind
This is alwayssql#importContext.
Returns
Type
Description
string
setKind
This is alwayssql#importContext.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getFileType
The file type for the specified uri.`SQL: The file
contains SQL statements. \CSV`: The file contains CSV data.
Returns
Type
Description
int
setFileType
The file type for the specified uri.`SQL: The file
contains SQL statements. \CSV`: The file contains CSV data.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Sql Admin V1 Client - Class ImportContext (1.2.6)\n\nVersion latestkeyboard_arrow_down\n\n- [1.2.6 (latest)](/php/docs/reference/cloud-sql-admin/latest/V1.ImportContext)\n- [1.2.5](/php/docs/reference/cloud-sql-admin/1.2.5/V1.ImportContext)\n- [1.1.0](/php/docs/reference/cloud-sql-admin/1.1.0/V1.ImportContext)\n- [1.0.0](/php/docs/reference/cloud-sql-admin/1.0.0/V1.ImportContext)\n- [0.19.0](/php/docs/reference/cloud-sql-admin/0.19.0/V1.ImportContext)\n- [0.18.0](/php/docs/reference/cloud-sql-admin/0.18.0/V1.ImportContext)\n- [0.17.1](/php/docs/reference/cloud-sql-admin/0.17.1/V1.ImportContext)\n- [0.16.1](/php/docs/reference/cloud-sql-admin/0.16.1/V1.ImportContext)\n- [0.12.0](/php/docs/reference/cloud-sql-admin/0.12.0/V1.ImportContext)\n- [0.11.0](/php/docs/reference/cloud-sql-admin/0.11.0/V1.ImportContext)\n- [0.10.0](/php/docs/reference/cloud-sql-admin/0.10.0/V1.ImportContext)\n- [0.9.0](/php/docs/reference/cloud-sql-admin/0.9.0/V1.ImportContext)\n- [0.8.0](/php/docs/reference/cloud-sql-admin/0.8.0/V1.ImportContext)\n- [0.7.0](/php/docs/reference/cloud-sql-admin/0.7.0/V1.ImportContext)\n- [0.6.0](/php/docs/reference/cloud-sql-admin/0.6.0/V1.ImportContext)\n- [0.5.0](/php/docs/reference/cloud-sql-admin/0.5.0/V1.ImportContext)\n- [0.4.1](/php/docs/reference/cloud-sql-admin/0.4.1/V1.ImportContext)\n- [0.3.1](/php/docs/reference/cloud-sql-admin/0.3.1/V1.ImportContext)\n- [0.2.12](/php/docs/reference/cloud-sql-admin/0.2.12/V1.ImportContext) \nReference documentation and code samples for the Google Cloud Sql Admin V1 Client class ImportContext.\n\nDatabase instance import context.\n\nGenerated from protobuf message `google.cloud.sql.v1.ImportContext`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Sql \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getUri\n\nPath to the import file in Cloud Storage, in the form\n`gs://bucketName/fileName`. Compressed gzip files (.gz) are supported\nwhen `fileType` is `SQL`. The instance must have\nwrite permissions to the bucket and read access to the file.\n\n### setUri\n\nPath to the import file in Cloud Storage, in the form\n`gs://bucketName/fileName`. Compressed gzip files (.gz) are supported\nwhen `fileType` is `SQL`. The instance must have\nwrite permissions to the bucket and read access to the file.\n\n### getDatabase\n\nThe target database for the import. If `fileType` is `SQL`, this field\nis required only if the import file does not specify a database, and is\noverridden by any database specification in the import file. If\n`fileType` is `CSV`, one database must be specified.\n\n### setDatabase\n\nThe target database for the import. If `fileType` is `SQL`, this field\nis required only if the import file does not specify a database, and is\noverridden by any database specification in the import file. If\n`fileType` is `CSV`, one database must be specified.\n\n### getKind\n\nThis is always `sql#importContext`.\n\n### setKind\n\nThis is always `sql#importContext`.\n\n### getFileType\n\nThe file type for the specified uri.\\`SQL`: The file\ncontains SQL statements. \\`CSV\\`: The file contains CSV data.\n\n### setFileType\n\nThe file type for the specified uri.\\`SQL`: The file\ncontains SQL statements. \\`CSV\\`: The file contains CSV data.\n\n### getCsvImportOptions\n\nOptions for importing data as CSV.\n\n### hasCsvImportOptions\n\n### clearCsvImportOptions\n\n### setCsvImportOptions\n\nOptions for importing data as CSV.\n\n### getImportUser\n\nThe PostgreSQL user for this import operation. PostgreSQL instances only.\n\n### setImportUser\n\nThe PostgreSQL user for this import operation. PostgreSQL instances only.\n\n### getBakImportOptions\n\nImport parameters specific to SQL Server .BAK files\n\n### hasBakImportOptions\n\n### clearBakImportOptions\n\n### setBakImportOptions\n\nImport parameters specific to SQL Server .BAK files\n\n### getSqlImportOptions\n\nOptional. Options for importing data from SQL statements.\n\n### hasSqlImportOptions\n\n### clearSqlImportOptions\n\n### setSqlImportOptions\n\nOptional. Options for importing data from SQL statements."]]