Skip to content

Instantly share code, notes, and snippets.

@VeryFatBoy
Forked from robrich/singlestore-to-s3.sql
Created October 12, 2021 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VeryFatBoy/5211c5fc1a6c6aa50cb9d48b386fe1fd to your computer and use it in GitHub Desktop.
Save VeryFatBoy/5211c5fc1a6c6aa50cb9d48b386fe1fd to your computer and use it in GitHub Desktop.
SingleStore to AWS S3
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 S3 'bucket-name/messages.csv'
CONFIG '{"region":"us-east-1"}'
CREDENTIALS '{"aws_access_key_id":"YOUR_KEY","aws_secret_access_key":"YOUR_SECRET"}';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment