Skip to content

Instantly share code, notes, and snippets.

@swt30
Last active February 5, 2025 12:43
Show Gist options
  • Save swt30/7e4106a9a353cf82019cb92fc5ee93ee to your computer and use it in GitHub Desktop.
Save swt30/7e4106a9a353cf82019cb92fc5ee93ee to your computer and use it in GitHub Desktop.
services:
postgres:
build:
target: postgres
ports:
- "5432:5432"
environment:
POSTGRES_PASSWORD: password
clickhouse:
build:
target: clickhouse
develop:
watch:
- path: ./Dockerfile
action: rebuild
ports:
- "9000:9000"
FROM postgres:17.2 AS postgres
RUN echo "create table test as (select '2025-01-02 03:04:05.678900'::timestamptz as ts, '2025-01-02'::date as d);" > /docker-entrypoint-initdb.d/table.sql
FROM clickhouse/clickhouse-server:25.1.3.23 AS clickhouse
# FROM clickhouse/clickhouse-server:24.12 AS clickhouse
RUN echo "create table test (ts DateTime64(6, 'UTC'), d Date) engine = PostgreSQL('postgres:5432', 'postgres', 'test', 'postgres', 'password')" > /docker-entrypoint-initdb.d/postgres.sql
up:
docker compose up --watch
bug:
docker compose exec clickhouse clickhouse-client -q "select ts from test where ts > '2025-01-01 00:00:00'::DateTime64"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment