arangodb erlang数据库驱动
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

41 righe
2.5 KiB

  1. # eArango
  2. arangodb erlang driver
  3. erlang otp21.2+ arangodb 3.6.2 3.7
  4. # Feature
  5. Efficient, fast and easy to use.
  6. 1. To make this driver as efficient as possible, customizations encapsulate an HTTP1.1 client(agVstCli) with connection pooling.
  7. Comparisons between packaged agVstCli and similar HTTP client tests are available:[Address](https://github.com/SisMaker/httpc_bench)
  8. 2. This driver can use connection pooling or simply establish multiple connections in a single process (non-connection pooling mode) for various data operations.
  9. Synchronous and asynchronous operations are supported when using connection pooling,
  10. and you need to save the requestId extra if you want to use asynchronous operations Waiting for the received data to return,
  11. the API encapsulated by the current driver all USES synchronous operation, and can be modified if asynchronous operation is needed.
  12. Only synchronous operations are supported for single-process operations.
  13. In single-process mode, compared with connection pooling mode, data replication between processes can be reduced once.
  14. For operation of large amount of data, database connection can be established separately in data management process instead of connection pooling.
  15. 3. The connection pooling mode and connectionless pool mode API interface ensures the identity, does not need to be treated differently,
  16. and is easy to understand and change between connection pooling mode and connectionless pool mode.
  17. # Batch requests are not supported
  18. https://www.arangodb.com/docs/stable/http/batch-request.html
  19. # compile
  20. rebar get-deps; rebar compile or rebar3 compile
  21. Note: If you build Jiffy on The Windows platform, you will need to set up an additional compilation environment. [See jiffy for details](https://github.com/SisMaker/erlUtils/tree/master/src/docs)
  22. # how to use
  23. rebar: erl -pa ./ebin -pa ./deps/jiffy/ebin or
  24. revar3: rebar3 shell
  25. Non-connection pooling mode
  26. Make a connection first
  27. {ok, Socket} = agVstCli:connect([]). %% Use default Settings
  28. %% Then you can then call various apis using Socket as the first argument
  29. agMgrDb:curDbInfo(Socket).
  30. Connection pooling mode
  31. application:ensure_all_started(eArango). %% start app
  32. agVstCli:startPool(poolName, [], []). %% start pool
  33. %% Then you can then invoke various apis using poolName as the first argument
  34. agMgrDb:curDbInfo(poolName).