rivven-connect-derive
Procedural macros for Rivven connector development. Reduces boilerplate when building custom connectors with automatic config schema generation.
Usage
Add to your Cargo.toml:
[]
= "0.0.22" # Re-exports derive macros
# Or directly:
# rivven-connect-derive = "0.0.22"
Available Macros
SourceConfig
Derive macro for source connector configurations. Generates a *Spec struct with spec(), name(), and version() methods, including automatic JSON Schema generation.
use *;
use SourceConfigDerive;
// Generates: PostgresCdcConfigSpec with:
// - spec() -> ConnectorSpec (with config_schema)
// - name() -> &'static str
// - version() -> &'static str
SinkConfig
Derive macro for sink connector configurations:
use *;
use SinkConfigDerive;
// Generates: S3SinkConfigSpec with:
// - spec() -> ConnectorSpec (with config_schema)
// - name() -> &'static str
// - version() -> &'static str
// - batch_config() -> BatchConfig (when batching = true)
TransformConfig
Derive macro for transform configurations:
use *;
use TransformConfigDerive;
// Generates: JsonFilterConfigSpec with spec(), name(), version() methods
connector_spec (attribute macro)
Define connector specifications inline for modules:
use connector_spec;
// Generates: connector_spec() function returning ConnectorSpec
Attributes Reference
Source Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
name |
string | struct name (lowercase, -config removed) | Connector identifier |
version |
string | "0.0.1" | Semantic version |
description |
string | - | Human-readable description |
author |
string | - | Author or maintainer |
license |
string | - | License identifier (e.g., "Apache-2.0") |
documentation_url |
string | - | Documentation URL |
incremental |
flag | false | Supports incremental sync |
Sink Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
name |
string | struct name (lowercase, -config removed) | Connector identifier |
version |
string | "0.0.1" | Semantic version |
description |
string | - | Human-readable description |
author |
string | - | Author or maintainer |
license |
string | - | License identifier |
documentation_url |
string | - | Documentation URL |
batching |
flag | false | Enable batch_config() method |
batch_size |
usize | 10,000 | Default batch size |
Using with Source/Sink Implementations
use *;
use SourceConfigDerive;
;
License
See root LICENSE file.