Skip to content

Commit cdab77b

Browse files
authored
Merge pull request #3 from psteinroe/chore/improve-config-loading
refactor: improve config loading
2 parents 5992df3 + 13832a2 commit cdab77b

12 files changed

Lines changed: 496 additions & 17 deletions

File tree

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ test-results/
3939
# Keep these for build
4040
!.cargo/config.toml
4141
!migrations/
42+
!configuration/

Cargo.lock

Lines changed: 32 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ test-utils = ["dep:testcontainers", "dep:testcontainers-modules"]
1010
[dependencies]
1111
anyhow = { version = "1.0.98", default-features = false, features = ["std"] }
1212
chrono = { version = "0.4.41", default-features = false }
13+
config = { version = "0.14", default-features = false, features = ["yaml", "json"] }
1314
const-oid = { version = "0.9.6", default-features = false }
1415
futures = { version = "0.3.31", default-features = false }
1516
metrics = { version = "0.24.2", default-features = false }
@@ -28,6 +29,7 @@ sqlx = { version = "0.8.6", default-features = false, features = [
2829
"chrono",
2930
"uuid",
3031
] }
32+
thiserror = { version = "2.0", default-features = false }
3133
tokio = { version = "1.47.0", default-features = false, features = ["rt-multi-thread", "macros", "signal"] }
3234
tokio-postgres = { git = "https://github.com/MaterializeInc/rust-postgres", default-features = false, rev = "c4b473b478b3adfbf8667d2fbe895d8423f1290b", features = [
3335
"runtime",
@@ -41,7 +43,6 @@ tracing-subscriber = { version = "0.3", default-features = false, features = ["f
4143
x509-cert = { version = "0.2.2", default-features = false }
4244

4345
etl = { git = "https://github.com/supabase/etl", rev = "483c7cfaf2b3730413acce8e0b4ad79a8cf28bbd" }
44-
etl-config = { git = "https://github.com/supabase/etl", rev = "483c7cfaf2b3730413acce8e0b4ad79a8cf28bbd" }
4546
etl-postgres = { git = "https://github.com/supabase/etl", rev = "483c7cfaf2b3730413acce8e0b4ad79a8cf28bbd" }
4647
uuid = { version = "1.19.0", default-features = false, features = ["v4"] }
4748

@@ -57,6 +58,8 @@ testcontainers = { version = "0.23", optional = true }
5758
testcontainers-modules = { version = "0.11", optional = true, features = ["postgres"] }
5859

5960
[dev-dependencies]
61+
temp-env = "0.3"
62+
tempfile = "3.13"
6063

6164
[lints.clippy]
6265
fallible_impl_from = "deny"

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ WORKDIR /app
4747
# Create non-root user (distroless already has nonroot user)
4848
USER nonroot:nonroot
4949

50-
# Copy binary
50+
# Copy binary and configuration files
5151
COPY --from=builder /app/target/release/postgres-stream ./postgres-stream
52+
COPY configuration/ ./configuration/
5253

5354
# Use exec form for proper signal handling
5455
ENTRYPOINT ["./postgres-stream"]

configuration/base.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Base configuration for daemon
2-
# This file contains default settings that apply to all environments
3-
41
stream:
52
id: 1
63
pg_connection:
@@ -12,8 +9,8 @@ stream:
129
enabled: false
1310
trusted_root_certs: ""
1411
batch:
15-
max_size: 100
16-
max_fill_ms: 50
12+
max_size: 1000
13+
max_fill_ms: 1000
1714

1815
sink:
1916
type: memory

src/concurrency/stream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use core::pin::Pin;
22
use core::task::{Context, Poll};
3-
use etl_config::shared::BatchConfig;
3+
use etl::config::BatchConfig;
44
use futures::{Future, Stream, ready};
55
use pin_project_lite::pin_project;
66
use std::time::Duration;

0 commit comments

Comments
 (0)