TectonicDB client library for Elixir to read/write L2 order book data
Documentation:
# open connection
{:ok, conn} = ExTectonicdb.start_link(host: {127, 0, 0, 1}, port: 9001)
# switch database
{:ok, _name} = ExTectonicdb.Commands.use_db(conn, "binance-btc_usdt")
# insert row
# ADD 1505177459.685, 139010, t, f, 0.0703620, 7.65064240;
row = %ExTectonicdb.Row{timestamp: 1505177459.685, sequence: 139010, is_trade: true, is_bid: false, price: 0.0703620, size: 7.65064240}
{:ok, row} = ExTectonicdb.Commands.add(conn, [row])
# INSERT 1505177459.685, 139010, t, f, 0.0703620, 7.65064240; INTO dbname
{:ok, row} = ExTectonicdb.Commands.insert_into(conn, "binance-btc_usdt", [row])
The package can be installed by adding ex_tectonicdb
to your list of dependencies in mix.exs
:
def deps do
[
{:ex_tectonicdb, "~> 0.1.3"}
]
end
To run tests, you must have tectonicdb
running for tests to work. This can be done either by starting tectonicdb on port 9001
manually or running docker compose:
docker-compose up
- Then, run the tests with
mix test
- Yuri Koval'ov - hello@yurikoval.com
ex_tectonicdb
is released under the MIT license