FAQ

Chris Leishman edited this page Aug 16, 2016 · 12 revisions
Clone this wiki locally

Is neo4j-client a complete command line interface (CLI)?

Absolutely. neo4j-client is designed to provide the best experience when working with Neo4j from the command line.

Does neo4j-client support multi-line input?

Yes. neo4j-client will evaluate a cypher statement when the enter key is pressed after the terminating semicolon (;) is present. If there is no semicolon (;), then the enter key will start a new line.

Can neo4j-client be scripted?

Yes. neo4j-client provides a non-interactive (batch) mode that supports reading of input from a file (e.g. movies.cyp), specified using the --source file argument, or streamed in via stdin. The results will be written to stdout, or to a file specified using --output file. In non-interactive mode, the default format for results is CSV.

Does neo4j-client support transactions?

Yes. Simply use the standard cypher statements begin;, commit; or rollback;. Use of nested transactions is possible only if supported by Neo4j server.

Is libneo4j-client a complete neo4j driver?

Yes, and no. libneo4j-client aims to provide all the basic underpinnings required for communicating with a neo4j server, but it doesn't try to provide a complete driver experience. For example, a complete driver would likely provide high-level APIs for transactions, wrapping around "BEGIN", "COMMIT" and "ROLLBACK" statements. libneo4j-client provides no such API.

It is anticipated that libneo4j-client will be of most benefit for implementing complete drivers in other languages (which can call native C libraries), and thus providing higher-level abstractions will be better done using the idioms and techniques of the target language.

Is libneo4j-client thread safe?

Yes. All methods are re-entrant and there is no shared global state (aside from what OpenSSL has internally). Note, however, that the data structures are not synchronized: you can't share the same connection, session or result stream between multiple threads without external synchronization.

Does libneo4j-client re-use network connections?

No, but you can add your own pooling. As libneo4j-client has no global state, it doesn't save and re-use connections. However, it is possible to provide your own connection factory (see neo4j_config_set_connection_factory(...) and struct neo4j_connection_factory to wrap the standard connection factory and thus re-use connections.

Does libneo4j-client pool memory?

No, but you can add your own pooling. See neo4j_config_set_memory_allocator(...).