1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// SPDX-License-Identifier: BUSL-1.1
//! `CREATE TABLE` DDL handler — strict-default Postgres-style syntax.
//!
//! Thin wrapper over [`super::build::build_and_persist`] — the entire
//! validation + storage + replication body is shared with the
//! [`super::handler::create_collection`] path; the only TABLE-specific
//! knobs are the labels, the mandatory column list, and the
//! strict-by-default engine mapping.
use DatabaseId;
use Response;
use PgWireResult;
use crateAuthenticatedIdentity;
use crateSharedState;
use ;
use CreateCollectionRequest;
/// Handle `CREATE [IF NOT EXISTS] TABLE <name> (<col_list>) [WITH (engine='...')]`.
///
/// All fields are pre-parsed from the `nodedb-sql` AST:
/// - `engine`: value of `engine=` from the WITH clause (lowercased), or `None` for default
/// (which is `document_strict` for CREATE TABLE).
/// - `columns`: `(name, type)` pairs from the parenthesised column list.
/// - `options`: remaining WITH clause `key=value` pairs (excluding `engine`).
/// - `flags`: free-standing modifier keywords: `APPEND_ONLY`, `HASH_CHAIN`, `BITEMPORAL`.
/// - `balanced_raw`: raw inner content of `BALANCED ON (...)`, if present.
pub async