Skip to content

Add ability to detect NULL values #120

Closed
@lubomirmatus

Description

@lubomirmatus

The lib now does not have ability to detect that some value in row is NULL.

col1, col2, col3
0,0,0
0,0,
0,,0
,0,0

When reading numeric rows

CSVReader<3, trim_chars<>, double_quote_escape<',', '\"'>> csv(file);
int col1, col2, col3;
csv.read_row(col1, col2, col3);

the columns with missing values are returned as 0, so we cannot determine wheather it is real 0 or NULL.

Possible proposal is to use some kind of "nullable" wrapping type.

CSVReader<3, trim_chars<>, double_quote_escape<',', '\"'>> csv(file);
Nullable<int> col1, col2, col3;
csv.read_row(col1, col2, col3);
if (col1.is_null()) { ... }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions