Skip to content

Commit 32319cf

Browse files
authored
ref(types): Rework how types are structured and exported (supabase#290)
1 parent 798338b commit 32319cf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1455
-1506
lines changed

etl-api/src/routes/pipelines.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use actix_web::{
77
use chrono::Utc;
88
use etl_config::shared::{ReplicatorConfig, SupabaseConfig, TlsConfig};
99
use etl_postgres::replication::{TableLookupError, get_table_name_from_oid, health, state};
10-
use etl_postgres::schema::TableId;
10+
use etl_postgres::types::TableId;
1111
use secrecy::ExposeSecret;
1212
use serde::{Deserialize, Serialize};
1313
use sqlx::{PgPool, PgTransaction};

etl-benchmarks/benches/table_copies.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use etl::types::{Event, TableRow};
88
use etl_config::Environment;
99
use etl_config::shared::{BatchConfig, PgConnectionConfig, PipelineConfig, TlsConfig};
1010
use etl_destinations::bigquery::{BigQueryDestination, install_crypto_provider_for_bigquery};
11-
use etl_postgres::schema::TableId;
11+
use etl_postgres::types::TableId;
1212
use etl_telemetry::tracing::init_tracing;
1313
use sqlx::postgres::PgPool;
1414
use std::error::Error;

etl-destinations/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ iceberg = ["dep:iceberg", "dep:iceberg-catalog-rest"]
1616

1717
[dependencies]
1818
etl = { workspace = true }
19-
etl-postgres = { workspace = true }
2019
chrono = { workspace = true }
2120

2221
futures = { workspace = true, optional = true }

etl-destinations/src/bigquery/client.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use etl::error::{ErrorKind, EtlError, EtlResult};
22
use etl::etl_error;
3-
use etl::types::{Cell, ColumnSchema, TableRow, Type};
4-
use etl_postgres::types::is_array_type;
3+
use etl::types::{Cell, ColumnSchema, TableRow, Type, is_array_type};
54
use gcp_bigquery_client::google::cloud::bigquery::storage::v1::RowError;
65
use gcp_bigquery_client::storage::ColumnMode;
76
use gcp_bigquery_client::yup_oauth2::parse_service_account_key;

etl-destinations/src/bigquery/encoding.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
use crate::bigquery::validation::validate_cell_for_bigquery;
22
use etl::error::EtlError;
33
use etl::etl_error;
4-
use etl::types::{ArrayCellNonOptional, CellNonOptional, TableRow};
5-
use etl_postgres::time::{DATE_FORMAT, TIME_FORMAT, TIMESTAMP_FORMAT, TIMESTAMPTZ_FORMAT_HH_MM};
4+
use etl::types::{
5+
ArrayCellNonOptional, CellNonOptional, DATE_FORMAT, TIME_FORMAT, TIMESTAMP_FORMAT,
6+
TIMESTAMPTZ_FORMAT_HH_MM, TableRow,
7+
};
68
use prost::bytes;
79

810
/// Protocol buffer wrapper for a BigQuery table row containing non-optional cells.

etl-destinations/src/iceberg/schema.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use std::sync::Arc;
22

3-
use etl::types::{TableSchema, Type};
4-
use etl_postgres::types::is_array_type;
3+
use etl::types::{TableSchema, Type, is_array_type};
54
use iceberg::spec::{
65
ListType, NestedField, PrimitiveType, Schema as IcebergSchema, Type as IcebergType,
76
};

etl-postgres/.sqlx/query-bc8119f0a137815cb238b9b2bdec2160ff9d6eb23e2e0bd92f3d1581bc4a30e0.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

etl-postgres/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
66
#[cfg(feature = "replication")]
77
pub mod replication;
8-
pub mod schema;
98
#[cfg(feature = "sqlx")]
109
pub mod sqlx;
11-
pub mod time;
1210
#[cfg(feature = "tokio")]
1311
pub mod tokio;
1412
pub mod types;

etl-postgres/src/replication/db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use etl_config::shared::{IntoConnectOptions, PgConnectionConfig};
22
use sqlx::{PgPool, Row, postgres::PgPoolOptions};
33
use thiserror::Error;
44

5-
use crate::schema::{TableId, TableName};
5+
use crate::types::{TableId, TableName};
66

77
/// Errors that can occur during table lookups.
88
#[derive(Debug, Error)]

etl-postgres/src/replication/schema.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use sqlx::{PgExecutor, PgPool, Row};
44
use std::collections::HashMap;
55
use tokio_postgres::types::Type as PgType;
66

7-
use crate::schema::{ColumnSchema, TableId, TableName, TableSchema};
7+
use crate::types::{ColumnSchema, TableId, TableName, TableSchema};
88

99
macro_rules! define_type_mappings {
1010
(

0 commit comments

Comments
 (0)