Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions integration/copy_data/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.bak.toml
17 changes: 17 additions & 0 deletions integration/copy_data/connect.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

case "$1" in
source)
PGPASSWORD=pgdog psql -h 127.0.0.1 -p 15432 -U pgdog -d pgdog
;;
shard_0|0)
PGPASSWORD=pgdog psql -h 127.0.0.1 -p 15433 -U pgdog -d pgdog1
;;
shard_1|1)
PGPASSWORD=pgdog psql -h 127.0.0.1 -p 15434 -U pgdog -d pgdog2
;;
*)
echo "Usage: $0 {source|shard_0|0|shard_1|1}"
exit 1
;;
esac
3 changes: 2 additions & 1 deletion integration/copy_data/dev.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash
set -e
trap 'kill 0' SIGINT SIGTERM
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
DEFAULT_BIN="${SCRIPT_DIR}/../../target/release/pgdog"
DEFAULT_BIN="${SCRIPT_DIR}/../../target/debug/pgdog"
PGDOG_BIN=${PGDOG_BIN:-$DEFAULT_BIN}

export PGUSER=pgdog
Expand Down
41 changes: 41 additions & 0 deletions integration/copy_data/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
services:
source:
image: postgres:18
command: postgres -c wal_level=logical
environment:
POSTGRES_USER: pgdog
POSTGRES_PASSWORD: pgdog
POSTGRES_DB: pgdog
volumes:
- ./setup.sql:/docker-entrypoint-initdb.d/setup.sql
ports:
- 15432:5432
networks:
- postgres

shard_0:
image: postgres:18
command: postgres -c wal_level=logical
environment:
POSTGRES_USER: pgdog
POSTGRES_PASSWORD: pgdog
POSTGRES_DB: pgdog1
ports:
- 15433:5432
networks:
- postgres

shard_1:
image: postgres:18
command: postgres -c wal_level=logical
environment:
POSTGRES_USER: pgdog
POSTGRES_PASSWORD: pgdog
POSTGRES_DB: pgdog2
ports:
- 15434:5432
networks:
- postgres

networks:
postgres:
2 changes: 1 addition & 1 deletion integration/copy_data/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ DROP SCHEMA IF EXISTS copy_data CASCADE;
\c pgdog2
DROP SCHEMA IF EXISTS copy_data CASCADE;
\c pgdog
DROP SCHEMA IF EXISTS copy_data CASCADE;
-- DROP SCHEMA IF EXISTS copy_data CASCADE;
SELECT pg_drop_replication_slot(slot_name) FROM pg_replication_slots;
\i setup.sql
Loading
Loading