razeri_plugin_contract/bulk_load_form.rs
1// Copyright (C) 2026 Gabriel Shea
2// Licensed under either of the Apache License, Version 2.0 or the MIT
3// license, at your option.
4
5//! **Which bulk-load statement an engine speaks**, among the ones Razeri
6//! writes.
7//!
8//! Razeri's bulk-load builder writes a load statement in a handful of
9//! engines' own grammars. Which one a platform gets is the dialect's answer
10//! ([`SqlRenderer::bulk_load_form`](crate::SqlRenderer::bulk_load_form)), so
11//! an engine that speaks a grammar Razeri already writes — a PostgreSQL-wire
12//! engine and `COPY` — gets it with no change to Razeri, and a platform
13//! Razeri has never been compiled against is never recognised by its name.
14
15/// **One bulk-load grammar Razeri writes.**
16#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
17#[non_exhaustive]
18pub enum BulkLoadForm {
19 /// `COPY <table> FROM …` — `PostgreSQL` and Citus.
20 PostgresCopy,
21 /// `BULK INSERT <table> FROM …` — SQL Server.
22 BulkInsert,
23 /// `COPY INTO <table> FROM @stage …` — Snowflake.
24 SnowflakeCopyInto,
25 /// `INSERT INTO <table> SELECT * FROM file(…)` and its kin — `ClickHouse`.
26 ClickHouseInsert,
27 /// `COPY <table> FROM '<path>' (…)` — `DuckDB`.
28 DuckDbCopy,
29 /// `COPY INTO <table> FROM '<path>' FILEFORMAT = …` — Databricks.
30 DatabricksCopyInto,
31 /// `LOAD DATA INFILE '<path>' INTO TABLE <table>` — `MySQL` and `MariaDB`.
32 LoadDataInfile,
33}