pub struct PostgresWriterConfig {Show 18 fields
pub cdc_op_column: String,
pub cdc_ts_column: String,
pub extra_columns: Vec<String>,
pub max_buffer_size: String,
pub max_records_in_buffer: Option<u64>,
pub mode: PostgresWriteMode,
pub on_conflict_do_nothing: Option<bool>,
pub ssl_ca_location: Option<String>,
pub ssl_ca_pem: Option<String>,
pub ssl_certificate_chain_location: Option<String>,
pub ssl_client_key: Option<String>,
pub ssl_client_key_location: Option<String>,
pub ssl_client_location: Option<String>,
pub ssl_client_pem: Option<String>,
pub table: String,
pub threads: u64,
pub uri: String,
pub verify_hostname: Option<bool>,
}Expand description
Postgres output connector configuration.
JSON schema
{
"description": "Postgres output connector configuration.",
"allOf": [
{
"description": "TLS/SSL configuration for PostgreSQL connectors.",
"type": "object",
"properties": {
"ssl_ca_location": {
"description": "Path to a file containing a sequence of CA certificates in PEM format.",
"type": [
"string",
"null"
]
},
"ssl_ca_pem": {
"description": "A sequence of CA certificates in PEM format.",
"type": [
"string",
"null"
]
},
"ssl_certificate_chain_location": {
"description": "The path to the certificate chain file.\nThe file must contain a sequence of PEM-formatted certificates,\nthe first being the leaf certificate, and the remainder forming\nthe chain of certificates up to and including the trusted root certificate.",
"type": [
"string",
"null"
]
},
"ssl_client_key": {
"description": "The client certificate key in PEM format.",
"type": [
"string",
"null"
]
},
"ssl_client_key_location": {
"description": "Path to the client certificate key.",
"type": [
"string",
"null"
]
},
"ssl_client_location": {
"description": "Path to the client certificate.",
"type": [
"string",
"null"
]
},
"ssl_client_pem": {
"description": "The client certificate in PEM format.",
"type": [
"string",
"null"
]
},
"verify_hostname": {
"description": "True to enable hostname verification when using TLS. True by default.\n\nWhen false, the certificate chain is still verified against the\ntrusted CA; only the requirement that the server name appears in the\ncertificate is lifted.",
"type": [
"boolean",
"null"
]
}
}
},
{
"type": "object",
"required": [
"table",
"uri"
],
"properties": {
"cdc_op_column": {
"description": "Name of the operation metadata column in CDC mode.\n\nOnly used when `mode = \"cdc\"`. This column will contain:\n- `\"i\"` for insert operations\n- `\"u\"` for upsert operations\n- `\"d\"` for delete operations\n\nDefault: `\"__feldera_op\"`",
"default": "__feldera_op",
"type": "string"
},
"cdc_ts_column": {
"description": "Name of the timestamp metadata column in CDC mode.\n\nOnly used when `mode = \"cdc\"`. This column will contain the timestamp\n(in RFC 3339 format) when the batch of updates was output\nby the pipeline.\n\nDefault: `\"__feldera_ts\"`",
"default": "__feldera_ts",
"type": "string"
},
"extra_columns": {
"description": "The names of the extra columns in the Postgres table that are not part of the view schema.\n\nThese connector can write user-defined values, configured using the `set_extra_columns` connector command,\nto these columns.",
"type": "array",
"items": {
"type": "string"
}
},
"max_buffer_size": {
"description": "The maximum buffer size for a single operation, such as `\"1Mi\"`.\nNote that the buffers of `INSERT`, `UPDATE` and `DELETE` queries are\nseparate.\nDefault: `\"1Mi\"`.\n\nBefore release 0.367.0 this setting was `max_buffer_size_bytes`, a\nnumber of bytes. That name is deprecated but still read.",
"default": "1Mi",
"type": "string"
},
"max_records_in_buffer": {
"description": "The maximum number of records in a single buffer.",
"type": [
"integer",
"null"
],
"minimum": 0.0
},
"mode": {
"default": "materialized",
"allOf": [
{
"$ref": "#/components/schemas/PostgresWriteMode"
}
]
},
"on_conflict_do_nothing": {
"description": "Specifies how the connector handles conflicts when executing an `INSERT`\ninto a table with a primary key. By default, an existing row with the same\nkey is overwritten. Setting this flag to `true` preserves the existing row\nand ignores the new insert.\n\nThis setting does not affect `UPDATE` statements, which always replace the\nvalue associated with the key.\n\nThis setting is not supported when `mode = \"cdc\"`, since all operations\nare performed as append-only `INSERT`s into the target table.\nAny conflict in CDC mode will result in an error.\n\nDefault: `false`",
"type": "boolean"
},
"table": {
"description": "The table to write the output to.",
"type": "string"
},
"threads": {
"description": "The number of threads to use during encoding.\n\nDefault: 1",
"default": 1,
"type": "integer",
"minimum": 0.0
},
"uri": {
"description": "Postgres URI.\nSee: <https://docs.rs/tokio-postgres/0.7.12/tokio_postgres/config/struct.Config.html>",
"type": "string"
}
}
}
]
}Fields§
§cdc_op_column: StringName of the operation metadata column in CDC mode.
Only used when mode = "cdc". This column will contain:
"i"for insert operations"u"for upsert operations"d"for delete operations
Default: "__feldera_op"
cdc_ts_column: StringName of the timestamp metadata column in CDC mode.
Only used when mode = "cdc". This column will contain the timestamp
(in RFC 3339 format) when the batch of updates was output
by the pipeline.
Default: "__feldera_ts"
extra_columns: Vec<String>The names of the extra columns in the Postgres table that are not part of the view schema.
These connector can write user-defined values, configured using the set_extra_columns connector command,
to these columns.
max_buffer_size: StringThe maximum buffer size for a single operation, such as "1Mi".
Note that the buffers of INSERT, UPDATE and DELETE queries are
separate.
Default: "1Mi".
Before release 0.367.0 this setting was max_buffer_size_bytes, a
number of bytes. That name is deprecated but still read.
max_records_in_buffer: Option<u64>The maximum number of records in a single buffer.
mode: PostgresWriteMode§on_conflict_do_nothing: Option<bool>Specifies how the connector handles conflicts when executing an INSERT
into a table with a primary key. By default, an existing row with the same
key is overwritten. Setting this flag to true preserves the existing row
and ignores the new insert.
This setting does not affect UPDATE statements, which always replace the
value associated with the key.
This setting is not supported when mode = "cdc", since all operations
are performed as append-only INSERTs into the target table.
Any conflict in CDC mode will result in an error.
Default: false
ssl_ca_location: Option<String>Path to a file containing a sequence of CA certificates in PEM format.
ssl_ca_pem: Option<String>A sequence of CA certificates in PEM format.
ssl_certificate_chain_location: Option<String>The path to the certificate chain file. The file must contain a sequence of PEM-formatted certificates, the first being the leaf certificate, and the remainder forming the chain of certificates up to and including the trusted root certificate.
ssl_client_key: Option<String>The client certificate key in PEM format.
ssl_client_key_location: Option<String>Path to the client certificate key.
ssl_client_location: Option<String>Path to the client certificate.
ssl_client_pem: Option<String>The client certificate in PEM format.
table: StringThe table to write the output to.
threads: u64The number of threads to use during encoding.
Default: 1
uri: String§verify_hostname: Option<bool>True to enable hostname verification when using TLS. True by default.
When false, the certificate chain is still verified against the trusted CA; only the requirement that the server name appears in the certificate is lifted.
Implementations§
Source§impl PostgresWriterConfig
impl PostgresWriterConfig
pub fn builder() -> PostgresWriterConfig
Trait Implementations§
Source§impl Clone for PostgresWriterConfig
impl Clone for PostgresWriterConfig
Source§impl Debug for PostgresWriterConfig
impl Debug for PostgresWriterConfig
Source§impl<'de> Deserialize<'de> for PostgresWriterConfig
impl<'de> Deserialize<'de> for PostgresWriterConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<&PostgresWriterConfig> for PostgresWriterConfig
impl From<&PostgresWriterConfig> for PostgresWriterConfig
Source§fn from(value: &PostgresWriterConfig) -> Self
fn from(value: &PostgresWriterConfig) -> Self
Source§impl From<PostgresWriterConfig> for PostgresWriterConfig
impl From<PostgresWriterConfig> for PostgresWriterConfig
Source§fn from(value: PostgresWriterConfig) -> Self
fn from(value: PostgresWriterConfig) -> Self
Source§impl Serialize for PostgresWriterConfig
impl Serialize for PostgresWriterConfig
Source§impl TryFrom<PostgresWriterConfig> for PostgresWriterConfig
impl TryFrom<PostgresWriterConfig> for PostgresWriterConfig
Source§type Error = ConversionError
type Error = ConversionError
Source§fn try_from(value: PostgresWriterConfig) -> Result<Self, ConversionError>
fn try_from(value: PostgresWriterConfig) -> Result<Self, ConversionError>
Auto Trait Implementations§
impl Forget for PostgresWriterConfig
impl Freeze for PostgresWriterConfig
impl Move for PostgresWriterConfig
impl RefUnwindSafe for PostgresWriterConfig
impl Send for PostgresWriterConfig
impl Sync for PostgresWriterConfig
impl Unpin for PostgresWriterConfig
impl UnsafeUnpin for PostgresWriterConfig
impl UnwindSafe for PostgresWriterConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more