# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: databse.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import List

import betterproto


class ColumnType(betterproto.Enum):
    """逻辑条件类型"""

    Long_ = 0
    Integer_ = 1
    Bool_ = 2
    Double_ = 3
    DateTime_ = 4
    String_ = 5


class DBType(betterproto.Enum):
    MySql = 0
    SQLServer = 1
    PostgreSQL = 2
    Oracle = 3
    MongoDB = 4
    DB2 = 5


class DBStatus(betterproto.Enum):
    Failed = 0
    Success = 1


class OrderType(betterproto.Enum):
    ASC = 0
    DESC = 1


class WriteMode(betterproto.Enum):
    Update = 0
    Append = 1
    Delete = 2


@dataclass
class TableInfo(betterproto.Message):
    # 数据连接器ID，长度(MAX_DB_STRING_LENGTH)
    db_id: str = betterproto.string_field(1)
    # 连接器名称，长度(MAX_DB_STRING_LENGTH)
    table_name: str = betterproto.string_field(2)
    # MAX_DB_COLUMNS
    info: List["ColumnInfo"] = betterproto.message_field(3)


@dataclass
class ColumnInfo(betterproto.Message):
    # 列名，长度(MAX_DB_STRING_LENGTH)
    name: str = betterproto.string_field(1)
    # 列信息数组，数组大小（0..MAX_DB_COLUMNS）
    type: "ColumnType" = betterproto.enum_field(2)


@dataclass
class CreateConInfo(betterproto.Message):
    net_i_d: str = betterproto.string_field(1)
    server: str = betterproto.string_field(2)
    user_id: str = betterproto.string_field(3)
    password: str = betterproto.string_field(4)
    type: "DBType" = betterproto.enum_field(5)


@dataclass
class CreateConReslut(betterproto.Message):
    status: "DBStatus" = betterproto.enum_field(1)
    msg: str = betterproto.string_field(2)
    db_id: str = betterproto.string_field(3)


@dataclass
class DelConInfo(betterproto.Message):
    db_id: str = betterproto.string_field(1)


@dataclass
class DelConResult(betterproto.Message):
    status: "DBStatus" = betterproto.enum_field(1)
    msg: str = betterproto.string_field(2)


@dataclass
class GetConInfo(betterproto.Message):
    name: str = betterproto.string_field(1)
    type: "DBType" = betterproto.enum_field(2)


@dataclass
class GetConReslut(betterproto.Message):
    status: "DBStatus" = betterproto.enum_field(1)
    msg: str = betterproto.string_field(2)
    db_id: str = betterproto.string_field(3)


@dataclass
class ReadStructInfo(betterproto.Message):
    db_id: str = betterproto.string_field(1)
    table_name: str = betterproto.string_field(2)
    order_by_column: str = betterproto.string_field(3)
    type: "OrderType" = betterproto.enum_field(4)
    start_id: int = betterproto.uint32_field(5)
    record_count: int = betterproto.uint32_field(6)
    column_names: List[str] = betterproto.string_field(7)


@dataclass
class ReadStructReslut(betterproto.Message):
    status: "DBStatus" = betterproto.enum_field(1)
    msg: str = betterproto.string_field(2)
    value: bytes = betterproto.bytes_field(3)


@dataclass
class WriteStructInfo(betterproto.Message):
    db_id: str = betterproto.string_field(1)
    table_name: str = betterproto.string_field(2)
    mode: "WriteMode" = betterproto.enum_field(3)
    start_id: int = betterproto.uint32_field(4)
    count: int = betterproto.uint32_field(5)
    column_names: List[str] = betterproto.string_field(6)
    value: bytes = betterproto.bytes_field(7)


@dataclass
class WriteStructReslut(betterproto.Message):
    status: "DBStatus" = betterproto.enum_field(1)
    msg: str = betterproto.string_field(2)
