88
99## Installation
1010
11- ` nodemgclient ` is a wrapper around the
12- [ mgclient] ( https://github.com/memgraph/mgclient ) .
11+ ### Build from Source on Linux
1312
14- ### Build from Source
15-
16- To install ` nodemgclient ` from sources you will need (only Linux is tested at
17- the moment):
13+ To install ` nodemgclient ` from sources you will need (only Linux is tested at
14+ the moment):
1815
1916* OpenSSL >= 1.0.2
2017* A CMake >= 3.10
21- * A Clang compiler supporting C11 standard
22- * A Clang compiler supporting C++17 standard
18+ * A Clang compiler supporting C11 and C++17 standard
2319* Node.js >= 12
2420
2521First install the prerequisites:
@@ -30,7 +26,7 @@ First install the prerequisites:
3026sudo apt install -y npm nodejs cmake make gcc g++ clang libssl-dev
3127```
3228
33- * On CentOS:
29+ * On RedHat/ CentOS:
3430
3531``` bash
3632sudo yum install -y npm nodejs cmake3 make gcc gcc-c++ clang openssl-devel
@@ -43,12 +39,40 @@ npm ci
4339npm run build:release
4440```
4541
46- To run tests, [ Docker] ( https://docs.docker.com/engine/install ) is required.
42+ To test ( [ Docker] ( https://docs.docker.com/engine/install ) is required) run:
4743
48- ## Windows
44+ ``` bash
45+ npm run test
46+ ```
47+ ### Build from Source on Windows
4948
5049NOTE: Not yet possible under MinGW.
5150
5251If installing OpenSSL package from
5352https://slproweb.com/products/Win32OpenSSL.html , make sure to use the full one
54- because of the header files.
53+ because of the header files.
54+
55+ ## Implementation and Interface Notes
56+
57+ ### Temporal Types
58+
59+ Suitable JS type to store Memgrpah temporal types don't exist. In particular,
60+ it's impossible to convert ` mg_duration ` and ` mg_local_time ` to the ` Date `
61+ type. Since [ the temporal
62+ specification] ( https://github.com/tc39/proposal-temporal ) is not yet widely
63+ supported, the decision was to expose plain JS objects (dict) with the exact
64+ fields ` mgclient ` is providing (for more details, please take a look under
65+ ` mgclient `
66+ [ header] ( https://github.com/memgraph/mgclient/blob/master/include/mgclient.h )
67+ and [ source] ( https://github.com/memgraph/mgclient/blob/master/src/mgclient.c )
68+ files). In addition, when possible (` mg_date ` and ` mg_local_date_time ` ), are
69+ converted into objects which have ` date ` property,
70+ which in fact, is the JS ` Date ` representation of these types. Keep in mind the
71+ loss of precision because JS ` Date ` time fields can only store up to
72+ milliseconds precision. However, Memgraph supports microsecond precision for
73+ the local time and therefore any use of the ` date ` property (JS ` Date ` object)
74+ can potentially cause loss of information.
75+
76+ Module exposes ` create ` functions, e.g. ` createMgDate ` , which simplify creation
77+ of temporal object interpretable by Memgraph. For more details take a look
78+ under the API docs under [ index.js] ( ./index.js ) file.
0 commit comments