sql_tools/statements/create/
mod.rs

1use crate::{Error, SQLImplementation};
2
3pub mod implement;
4pub mod sql_implementations;
5
6#[derive(Debug, Clone)]
7pub struct CreateTable {
8    pub connect: SQLImplementation,
9    pub columns: Vec<CreateColumns>,
10    pub table: String,
11}
12
13#[derive(Debug)]
14pub struct CreateProps {
15    pub connect: SQLImplementation,
16}
17
18#[derive(Debug, Clone)]
19pub struct CreateColumns {
20    pub name: String,
21    pub data_type: CreateDataTypes,
22}
23
24#[derive(Debug, Clone)]
25pub enum CreateDataTypes {
26    VARCHAR(usize),
27    NUMBER,
28    FLOAT,
29    DATE,
30}
31
32pub trait ModifyCreateTable {
33    /// Adds a column to the CREATE TABLE query.
34    fn add_column(&mut self, column: String, data_type: CreateDataTypes) -> Self;
35
36    /// Builds the query.
37    fn build(self) -> Result<(), Error>;
38}