Upgrade to rebar3, add Windows support

This patch updates erlfdb to build using rebar3. It relies on rebar3's
`pc` plugin to build the NIF instead of the compiled copy of davisp's
erlang-native-compiler, which does essentially the same thing. I left
the rebar_gdb_plugin code in the repo, although I did not update that
plugin to make it compatible with rebar3 yet.

With rebar3 in place, I also made the changes necessary to support
Windows. One gotcha is that the unit tests will fail unless you set
the erlfdb test_cluster_file environment variable to point to a running
fdb.cluster file. I didn't get through all the hoops to make the
approach of spinning up an embedded fdbserver work in a x-platform way.
Apparently Windows doesn't let you supply a Python script for the
spawn_executable argument of erlang:open_port/2. I added a rebar3
profile to help here. The following command will cause the test suite
to connect to an FDB server that is managing its configuration in the
default location on Windows:

  rebar3 as win32_external_fdbserver eunit
7 files changed
tree: b865a04a9ba01ec66a68fa2724650276c4c1040b
  1. c_src/
  2. include/
  3. notes/
  4. plugins/
  5. priv/
  6. src/
  7. test/
  8. .asf.yaml
  9. .gitignore
  10. BINDING_TESTER.md
  11. LICENSE
  12. Makefile
  13. README.md
  14. rebar.config
  15. rebar.lock
  16. win32_external_fdbserver.config
README.md

An Erlang Binding to FoundationDB

This project is a NIF wrapper for the FoundationDB C API. Documentation on the main API can be found here.

This project also provides a conforming implementation of the Tuple and Directory layers.

Building

Assuming you have installed the FoundationDB C API library, building erlfdb is as simple as:

$ make

Alternatively, adding erlfdb as a rebar dependency should Just Work ®.

Documentation for installing FoundationDB can be found here for macOS or here for Linux.

Quick Example

A simple example showing how to open a database and read and write keys:


Eshell V9.3.3.6 (abort with ^G) 1> Db = erlfdb:open(<<"/usr/local/etc/foundationdb/fdb.cluster">>). {erlfdb_database,#Ref<0.2859661758.3941466120.85406>} 2> ok = erlfdb:set(Db, <<"foo">>, <<"bar">>). ok 3> erlfdb:get(Db, <<"foo">>). <<"bar">> 4> erlfdb:get(Db, <<"bar">>). not_found

Binding Tester

FoundationDB has a custom binding tester that can be used to test whether changes have broken compatibility. See the BINDING_TESTER documentation for instructions on building and running that system.