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
8 changes: 8 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[build]
rustflags = ["-C", "target-cpu=native"]

[target.wasm32-unknown-unknown]
rustflags = ["-C", "target-feature=+avx2"]

[target.wasm32-wasi]
rustflags = ["-C", "target-feature=+avx2"]
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/target
.idea
*.iml
122 changes: 122 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ uuid = "*"
async-stream = "*"
futures = "*"
once_cell = "*"
simd-json = "0.7.0"
bytes = "1.4.0"
serde = "*"
serde_json = "*"
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A postgres instance with a `testdb` dfatabase and a `testtbl` table with a `id`
```postgresql
CREATE DATABASE testdb;
\c testdb;
CREATE TABLE testtbl (id int, name text);
CREATE TABLE testtbl (id int PRIMARY KEY, name text);

CREATE PUBLICATION testpub FOR TABLE testtbl;
INSERT INTO testtbl VALUES (1, 'snot');
Expand All @@ -28,3 +28,10 @@ potentially the starting position can be provided by a 2nd parameter
```bash
cargo run -- "host=127.0.0.1 port=5433 user=postgres password=password dbname=testdb" 0/17773B0
```


## Notes
the tables set for replication needs to have a primary key otherwise you get an error about Replication identity missing for the table updates
```sql
ALTER TABLE testtbl REPLICA IDENTITY DEFAULT;
```
4 changes: 4 additions & 0 deletions db.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM postgres:14.7

RUN apt-get update && apt-get install -y postgresql-14-wal2json

24 changes: 24 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: "3.4"

services:
db:
image: postgres:14.5
container_name: db
build:
context: .
dockerfile: db.dockerfile
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
command: -c wal_level=logical
ports:
- 5432:5432

adminer:
image: adminer
restart: always
depends_on:
- db
ports:
- 8080:8080
Loading