Skip to content

Instantly share code, notes, and snippets.

@robrich
Created March 25, 2021 02:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save robrich/33107046cf4c32fe4a4f454a3d78b0bd to your computer and use it in GitHub Desktop.
Save robrich/33107046cf4c32fe4a4f454a3d78b0bd to your computer and use it in GitHub Desktop.
SingleStore to Google Cloud Storage
CREATE DATABASE IF NOT EXISTS acme;
USE acme;
CREATE TABLE IF NOT EXISTS messages (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
content varchar(300) NOT NULL,
createdate TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO messages (
content
) VALUES (
'hello from SingleStore'
);
SELECT id, content, createdate
FROM messages
INTO GCS 'bucket-name/messages.csv'
CONFIG '{"region":"us-east1"}'
CREDENTIALS '{"access_id": "your_google_access_key", "secret_key": "your_google_secret_key"}';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment