aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Core/PostgreSQL/insertPostgreSQLValue.h
blob: 363b0c2d7a27fedee80b32b971203ba0e4771e41 (plain) (blame)
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
#pragma once

#include "clickhouse_config.h"

#if USE_LIBPQXX

#include <Core/Block.h>
#include <Core/ExternalResultDescription.h>
#include <Core/Field.h>


namespace DB
{

struct PostgreSQLArrayInfo
{
    size_t num_dimensions;
    Field default_value;
    std::function<Field(std::string & field)> pqxx_parser;
};


void insertPostgreSQLValue(
        IColumn & column, std::string_view value,
        const ExternalResultDescription::ValueType type, const DataTypePtr data_type,
        std::unordered_map<size_t, PostgreSQLArrayInfo> & array_info, size_t idx);

void preparePostgreSQLArrayInfo(
        std::unordered_map<size_t, PostgreSQLArrayInfo> & array_info, size_t column_idx, const DataTypePtr data_type);

void insertDefaultPostgreSQLValue(IColumn & column, const IColumn & sample_column);

}

#endif