Skip to content

How to store/retrieve in tkrzw database (C++): a double scalar, an array of doubles and text #48

@torfinno

Description

@torfinno

Hi,
I have been reading up on your 'tkrzw' as a potential replacement for Berkeley DB.

Based on some 'tkrzw' examples, I have tried to store and retrieve double scalars, vectors of doubles and text from a tkrzw-database. Unfortunately, I have not managed to create working code. I am using Linux.

Therefore, could you please give an example on how to save and retrieve from a tkrzw-database:
a) double scalars;
b) vector of doubles;
c) some text.

As an example, consider some daily temperature data:
~
temperatures = [ 19.1, 20.1, 21.1 ]; // C++: vector temperatures
average = 20.1; // C++: double average;
description = "The average is the sum of temperatures divided by three"; // C++: string description
~

Questions:
1: How to save the above into a tkrzw-database?
2. How to read back the saved information at a later stage, to do further numerical processing?

Best regards

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