Skip to content

Instantly share code, notes, and snippets.

@VeryFatBoy
VeryFatBoy / singlestore-to-gcs.sql
Created Oct 12, 2021 — forked from robrich/singlestore-to-gcs.sql
SingleStore to Google Cloud Storage
View singlestore-to-gcs.sql
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
);
View singlestore-to-s3.sql
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 Oct 12, 2021 — forked from robrich/sproc-delimiter.sql
SingleStore Stored Procedures
View sproc-delimiter.sql
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 Oct 12, 2021 — forked from robrich/select-into-var.sql
SQL Programmability with variables in SingleStore
View select-into-var.sql
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 Oct 12, 2021 — forked from robrich/data-load.sql
Loading Geography Data into SingleStore
View data-load.sql
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 Oct 12, 2021 — forked from robrich/sql-to-json.sql
Select relational data into JSON with SingleStore: to_json() and json_agg()
View sql-to-json.sql
-- 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 ()
View universal-storage-7.3.sql
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. */
View time-series.sql
-- TIME SERIES
-- ===========
-- setup schema
CREATE DATABASE temp_history;
USE temp_history;
CREATE TABLE temperatures (
location VARCHAR(200) NOT NULL,
View full-text-search.sql
-- FULL TEXT SEARCH
-- ================
-- setup schema
CREATE DATABASE library;
USE library;
CREATE TABLE books (
title VARCHAR(200) not null,
@VeryFatBoy
VeryFatBoy / cluster_file.yaml
Created Oct 12, 2021 — forked from robrich/cluster_file.yaml
Cluster configuration file
View cluster_file.yaml
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: