Skip to main content

nodedb_sql/ddl_ast/statement/
maintenance.rs

1// SPDX-License-Identifier: Apache-2.0
2
3/// Source for `COPY ... TO`.
4#[derive(Debug, Clone, PartialEq, Eq)]
5pub enum CopyToSource {
6    /// `COPY <collection> TO '<path>'` — export from a named collection.
7    Collection(String),
8    /// `COPY (SELECT ...) TO '<path>'` — export from an arbitrary query.
9    Query(String),
10}
11
12/// Format for `COPY ... FROM` bulk import.
13#[derive(Debug, Clone, PartialEq, Eq)]
14pub enum CopyFormat {
15    /// One JSON object per line (`.ndjson` / `.jsonl`).
16    Ndjson,
17    /// A JSON array of objects (`.json`).
18    JsonArray,
19    /// CSV with an optional header row (`.csv`).
20    Csv,
21}