https://github.com/hroptatyr/cotse
Column-Oriented Temporal Storage Engine
https://github.com/hroptatyr/cotse
Last synced: 3 months ago
JSON representation
Column-Oriented Temporal Storage Engine
- Host: GitHub
- URL: https://github.com/hroptatyr/cotse
- Owner: hroptatyr
- Created: 2016-01-14T08:47:40.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-11T08:51:58.000Z (over 9 years ago)
- Last Synced: 2025-06-27T13:39:35.840Z (3 months ago)
- Language: C
- Size: 361 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
cotse
=====cotse is a column-oriented temporal storage engine with a strong focus
on financial applications.Features
--------* [X] compressed
* [X] support for IEEE 754-2008 decimalsRed tape
--------+ licence: [BSD3c][1]
+ github:
+ issues:
+ releases:
+ contributions: welcomeThis is Pareto software, i.e. only the 80% case works.
Example
-------To write some data to a file-backed tick store:
#include
struct candle {
struct cots_tick_s proto;
cots_px_t o, h, l, c;
cots_qx_t v;
};
...
struct candle data;
cots_ts_t db = make_cots_ts("ppppq", 0U);
cots_put_fields(db, (const char*[]){"open","high","low","close","volume"});
cots_attach(db, "/tmp/tickdata", O_CREAT | O_TRUNC | O_RDWR);
while (get_candle(&data)) {
cots_write_tick(db, &data.proto);
}
...
cots_detach(db);
free_cots_ts(db);And to read the contents:
#include
struct candle_soa {
struct cots_tsoa_s proto;
cots_px_t *o, *h, *l, *c;
cots_qx_t *v;
};
...
struct candle_soa dsoa;
cots_ts_t db = cots_open_ts("/tmp/tickdata", O_RDONLY);
ssize_t n;
while ((n = cots_read_ticks(&dsoa.proto, db))) {
put_candle(&dsoa);
};
cots_close_ts(db);[1]: http://tldrlegal.com/license/bsd-3-clause-license-%28revised%29