Skip to content

Instantly share code, notes, and snippets.

View Winslett's full-sized avatar

Christopher Winslett Winslett

View GitHub Profile
@Winslett
Winslett / script.md
Last active December 4, 2025 16:47
pglake demo script

pg_lake demo

https://github.com/Snowflake-Labs/pg_lake

  • Open sourced pg_lake on Nov 4, 2025
  • this code is the basis of Crunchy Data Warehouse
  • enables read-write to cloud object storage with files in Iceberg, Parquet, CSV, JSON
  • All interactions are via SQL commands

Let’s get this running

@Winslett
Winslett / Dominion2.py
Last active April 16, 2025 12:11
test
#!/usr/bin/env python3
import random
import numpy as np
import time
from tabulate import tabulate
import csv
from itertools import chain
class Card:
def __init__(self, name, cost_value, space_value, available):
@Winslett
Winslett / data.sql
Last active February 5, 2024 18:54
Data for Row Level Security
--
-- PostgreSQL database dump
--
--
-- Name: accounts; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.accounts (
id BIGSERIAL PRIMARY KEY,
@Winslett
Winslett / _.txt
Last active January 4, 2024 21:07
Paths with a Difference
Path: /
@Winslett
Winslett / raw.sql
Last active August 9, 2023 00:15
data for lateral join
-- Create accounts table with ID, account_name, and a JSONB column for storing addresses
CREATE TABLE accounts (
id SERIAL PRIMARY KEY,
name VARCHAR(255),
addresses JSONB
);
-- Create purchases table with account_id, created_at, and product_name columns
CREATE TABLE purchases (
purchase_id SERIAL PRIMARY KEY,
@Winslett
Winslett / data.sql
Last active July 20, 2023 21:03
SQL for PostgresFDW example
CREATE TABLE public.accounts (
id SERIAL PRIMARY KEY,
name character varying,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL
);
CREATE TABLE public.carbon_removal_projects (
id SERIAL PRIMARY KEY,
CREATE TABLE public.accounts (
id bigint NOT NULL,
name character varying,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL
);
CREATE SEQUENCE public.accounts_id_seq
START WITH 1
@Winslett
Winslett / employees_dump.sql
Last active December 7, 2022 19:24
JSONB Example
--
CREATE TABLE public.employees (
id bigint NOT NULL,
first_name character varying,
last_name character varying,
start_date timestamp(6) without time zone,
job_title character varying,
salary integer,
manager_id character varying,
departments jsonb,
@Winslett
Winslett / 1-terminal-slow-queries.png
Last active May 16, 2022 14:24
Use SQL comments as a Stacktrace for database performance
1-terminal-slow-queries.png
@Winslett
Winslett / 1-programmer-bookshelf.png
Last active May 5, 2022 20:59
Demystifying Database Performance for Developers
1-programmer-bookshelf.png