njaard / sonnerie

A simple timeseries database
Other
266 stars 19 forks source link

May I support you with Sonnerie's API #5

Closed tokcum closed 4 years ago

tokcum commented 4 years ago

Dear Kalle,

I would like to use Sonnerie's API within my own Actix based web server. Besides that you state at the Sonneries repository "Sonnerie can be used as a Rust library so you can read and write databases directly, but the API is incomplete and poorly documented, for now." I managed to create and update a database.

As a contribution I would like to support Sonnerie's API in a first step with some documentation. What do you think? Do you have any specific idea about how this documentation should look like? I could just use Rusts capabilities to generate doc from the code base + additional annotations within the code.

What do you think?

Looking forward to hear from you soon.

Kind regards,

Tobias

njaard commented 4 years ago

Hi Tobias,

Your contributions are more than welcome, of course!

I recently added a lot of API docs. I think they could benefit from many examples.

The way reading work is that you get an OwnedRecord and then have to decode it into a serialized String with RowFormat. I hope to add support for decoding into real Rust types in a manner similar to how postgres crate lets to copy data into Rust types.

This is probably the least convenient part of the API and getting an understanding for it (by documenting) is probably a good start for actually making a nicer higher-level API.

Thanks!