File: //snap/google-cloud-cli/394/help/man/man1/gcloud_alpha_sql_export_csv.1
.TH "GCLOUD_ALPHA_SQL_EXPORT_CSV" 1
.SH "NAME"
.HP
gcloud alpha sql export csv \- exports data from a Cloud SQL instance to a CSV file
.SH "SYNOPSIS"
.HP
\f5gcloud alpha sql export csv\fR \fIINSTANCE\fR \fIURI\fR \fB\-\-query\fR=\fIQUERY\fR [\fB\-\-async\fR] [\fB\-\-database\fR=\fIDATABASE\fR,[\fIDATABASE\fR,...],\ \fB\-d\fR\ \fIDATABASE\fR,[\fIDATABASE\fR,...]] [\fB\-\-escape\fR=\fIESCAPE\fR] [\fB\-\-fields\-terminated\-by\fR=\fIFIELDS_TERMINATED_BY\fR] [\fB\-\-lines\-terminated\-by\fR=\fILINES_TERMINATED_BY\fR] [\fB\-\-offload\fR] [\fB\-\-quote\fR=\fIQUOTE\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
\fB(ALPHA)\fR Exports data from a Cloud SQL instance to a Google Cloud Storage
bucket as a plain text file with one line per row and comma\-separated fields.
.SH "POSITIONAL ARGUMENTS"
.RS 2m
.TP 2m
\fIINSTANCE\fR
Cloud SQL instance ID.
.TP 2m
\fIURI\fR
The path to the file in Google Cloud Storage where the export will be stored.
The URI is in the form gs://bucketName/fileName. If the file already exists, the
operation fails. If the filename ends with .gz, the contents are compressed.
.RE
.sp
.SH "REQUIRED FLAGS"
.RS 2m
.TP 2m
\fB\-\-query\fR=\fIQUERY\fR
A SQL SELECT query (e.g., SELECT * FROM table) that specifies the data to
export. WARNING: While in\-transit, the query might be processed in intermediate
locations other than the location of the target instance.
.RE
.sp
.SH "OPTIONAL FLAGS"
.RS 2m
.TP 2m
\fB\-\-async\fR
Return immediately, without waiting for the operation in progress to complete.
.TP 2m
\fB\-\-database\fR=\fIDATABASE\fR,[\fIDATABASE\fR,...], \fB\-d\fR \fIDATABASE\fR,[\fIDATABASE\fR,...]
Database(s) from which the export is made. Information on requirements can be
found here:
https://cloud.google.com/sql/docs/mysql/admin\-api/v1beta4/instances/export#exportContext.databases
.TP 2m
\fB\-\-escape\fR=\fIESCAPE\fR
Specifies the character that should appear before a data character that needs to
be escaped. The value of this argument has to be a character in Hex ASCII Code.
For example, "22" represents double quotes. This flag is only available for
MySQL and Postgres. If this flag is not provided, double quotes character will
be used as the default value.
.TP 2m
\fB\-\-fields\-terminated\-by\fR=\fIFIELDS_TERMINATED_BY\fR
Specifies the character that splits column values. The value of this argument
has to be a character in Hex ASCII Code. For example, "2C" represents a comma.
This flag is only available for MySQL and Postgres. If this flag is not
provided, a comma character will be used as the default value.
.TP 2m
\fB\-\-lines\-terminated\-by\fR=\fILINES_TERMINATED_BY\fR
Specifies the character that split line records. The value of this argument has
to be a character in Hex ASCII Code. For example, "0A" represents a new line.
This flag is only available for MySQL. If this flag is not provided, a new line
character will be used as the default value.
.TP 2m
\fB\-\-offload\fR
Offload an export to a temporary instance. Doing so reduces strain on source
instances and allows other operations to be performed while the export is in
progress.
.TP 2m
\fB\-\-quote\fR=\fIQUOTE\fR
Specifies the character that encloses values from columns that have string data
type. The value of this argument has to be a character in Hex ASCII Code. For
example, "22" represents double quotes. This flag is only available for MySQL
and Postgres. If this flag is not provided, double quotes character will be used
as the default value.
.RE
.sp
.SH "GCLOUD WIDE FLAGS"
These flags are available to all commands: \-\-access\-token\-file, \-\-account,
\-\-billing\-project, \-\-configuration, \-\-flags\-file, \-\-flatten,
\-\-format, \-\-help, \-\-impersonate\-service\-account, \-\-log\-http,
\-\-project, \-\-quiet, \-\-trace\-token, \-\-user\-output\-enabled,
\-\-verbosity.
Run \fB$ gcloud help\fR for details.
.SH "NOTES"
This command is currently in alpha and might change without notice. If this
command fails with API permission errors despite specifying the correct project,
you might be trying to access an API with an invitation\-only early access
allowlist. These variants are also available:
.RS 2m
$ gcloud sql export csv
.RE
.RS 2m
$ gcloud beta sql export csv
.RE