Skip to main content

TaskRenderer

Trait TaskRenderer 

Source
pub trait TaskRenderer: SqlRenderer {
    // Provided methods
    fn render_schedule_cron(
        &self,
        expression: &str,
        timezone: Option<&str>,
    ) -> String { ... }
    fn render_schedule_interval(&self, minutes: u32) -> String { ... }
    fn render_schedule_stream(&self, stream_name: &str) -> String { ... }
    fn render_schedule_event(&self, source: &str, description: &str) -> String { ... }
    fn render_create_task(
        &self,
        config: &TaskRenderConfig<'_>,
    ) -> Option<String> { ... }
    fn render_drop_task(&self, name: &str) -> String { ... }
    fn render_resume_task(&self, name: &str) -> String { ... }
    fn render_suspend_task(&self, name: &str) -> String { ... }
    fn render_bulk_load(
        &self,
        table: &str,
        source: &str,
        format: &str,
    ) -> Option<String> { ... }
}
Expand description

Task and schedule rendering for database-native orchestration.

Platform-specific task syntax is implemented by dialect plugins.

Provided Methods§

Source

fn render_schedule_cron( &self, expression: &str, timezone: Option<&str>, ) -> String

Render a cron-based schedule clause.

Source

fn render_schedule_interval(&self, minutes: u32) -> String

Render an interval-based schedule clause.

Source

fn render_schedule_stream(&self, stream_name: &str) -> String

Render a stream-based schedule trigger.

Source

fn render_schedule_event(&self, source: &str, description: &str) -> String

Render an event-driven schedule trigger.

Source

fn render_create_task(&self, config: &TaskRenderConfig<'_>) -> Option<String>

The statement that makes a task run on its schedule, or None where this engine has no scheduler of its own.

None is the default, and the honest answer for an engine whose statements run when they are sent: Razeri then refuses the task by name. A task written as its bare statement under a comment would run that statement at once, the moment the script ran, rather than on its schedule. Answer None too for a task whose enabled is false where your engine cannot make one disabled.

Source

fn render_drop_task(&self, name: &str) -> String

Render DROP TASK / unschedule.

Source

fn render_resume_task(&self, name: &str) -> String

Render ALTER TASK … RESUME or equivalent enable command.

Source

fn render_suspend_task(&self, name: &str) -> String

Render ALTER TASK … SUSPEND or equivalent disable command.

Source

fn render_bulk_load( &self, table: &str, source: &str, format: &str, ) -> Option<String>

The statement a task runs to load a file into a table — COPY INTO, BULK INSERT, LOAD DATA and their kin — or None where this engine has no such statement, and the task is refused by name.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§