Skip to content

TectonicDB client library for Elixir to read/write L2 order book data

License

Notifications You must be signed in to change notification settings

yurikoval/ex_tectonicdb

Repository files navigation

ExTectonicdb

Elixir Test

TectonicDB client library for Elixir to read/write L2 order book data

Documentation:

Examples

# 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])

Installation

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

Development / Test

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

Authors

License

ex_tectonicdb is released under the MIT license