Skip to content

Make data types bijective #72

@travis-leith

Description

@travis-leith

right now, we have clear conversions from KDB types to R types, but it is not bijective so converting from R to KDB is not clear.
For example, KDB time converts to R difftime, but KDB minute also converts to R difftime.

If I send R difftime to KDB, I get a dictionary on the other side with the attributes as keys.

But this gives us a clue for a useful refactor of rkdb. Lets use custom attributes in R to construct types that rkdb can convert into proper KDB types. For exmaple, make a function like rkdb::minute() that sets the attribute and ultimate results in a minute type in KDB. On the way back, the same thing happens. It is still a difftime in R, but has this attribute indicating which KDB type it came from.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions