Skip to content

Instantly share code, notes, and snippets.

@VeryFatBoy
VeryFatBoy / singlestore-to-gcs.sql
Created October 12, 2021 16:28 — forked from robrich/singlestore-to-gcs.sql
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
);
@VeryFatBoy
VeryFatBoy / singlestore-to-s3.sql
Created October 12, 2021 16:29 — forked from robrich/singlestore-to-s3.sql
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
);
@VeryFatBoy
VeryFatBoy / sproc-delimiter.sql
Created October 12, 2021 16:29 — forked from robrich/sproc-delimiter.sql
SingleStore Stored Procedures
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
);
@VeryFatBoy
VeryFatBoy / select-into-var.sql
Created October 12, 2021 16:29 — forked from robrich/select-into-var.sql
SQL Programmability with variables in SingleStore
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
);
@VeryFatBoy
VeryFatBoy / data-load.sql
Created October 12, 2021 16:29 — forked from robrich/data-load.sql
Loading Geography Data into SingleStore
create database maps;
use maps;
create table countries (
boundary geography,
name_short varchar(3),
name varchar(50),
name_long varchar(50),
abbrev varchar(10),
postal varchar(4),
@VeryFatBoy
VeryFatBoy / sql-to-json.sql
Created October 12, 2021 16:30 — forked from robrich/sql-to-json.sql
Select relational data into JSON with SingleStore: to_json() and json_agg()
-- Create database
create database if not exists acme;
use acme;
-- Create table
create rowstore table `record` (
`name` varchar(100) DEFAULT NULL,
`type` varchar(100) DEFAULT NULL,
`amount` int(11) DEFAULT NULL,
SHARD KEY ()
@VeryFatBoy
VeryFatBoy / universal-storage-7.3.sql
Created October 12, 2021 16:30 — forked from robrich/universal-storage-7.3.sql
Universal Storage in 7.3
create database db1;
use db1;
create table t(a int not null, shard(a), sort key());
insert t values(1);
delimiter //
/* Fill table t with n or more rows, doubling the size until
the goal is reached. */
@VeryFatBoy
VeryFatBoy / time-series.sql
Created October 12, 2021 16:30 — forked from robrich/time-series.sql
time-series.sql
-- TIME SERIES
-- ===========
-- setup schema
CREATE DATABASE temp_history;
USE temp_history;
CREATE TABLE temperatures (
location VARCHAR(200) NOT NULL,
-- FULL TEXT SEARCH
-- ================
-- setup schema
CREATE DATABASE library;
USE library;
CREATE TABLE books (
title VARCHAR(200) not null,
@VeryFatBoy
VeryFatBoy / cluster_file.yaml
Created October 12, 2021 16:31 — forked from robrich/cluster_file.yaml
Cluster configuration file
license: YOUR_LICENSE_KEY
memsql_server_version: 7.1.8
package_type: rpm
hosts:
- hostname: 127.0.0.1
localhost: true
nodes:
- register: false
role: Master
config: