on request_timeout help sign in
project-m36/docs/projectm36_client_library.markdown
37 lines 1.1 kB history raw
1# Project:M36 Client Library
3The Project:M36 client library is the preferred method for interacting with Project:M36 databases. It supports all features of the DBMS while other interfaces may not.
5The client supports both in-process and remote Project:M36 access.
7## Setup
91. Import the library's symbols
10```haskell
11import ProjectM36.Client
12```
132. Create a Connection with a ConnectionInfo in the Either monad
14```haskell
15conn <- connectProjectM36 (InProcessConnectionInfo NoPersistence)
16```
18## Executing Expressions
201. Execute relational expression queries
21```haskell
22result <- executeRelationalExpr conn (Union (RelationVariable "x") (RelationVariable "y"))
23```
242. Execute database context expressions which modify the current, mutable database context
25```haskell
26maybeErr <- executeDatabaseContextExpr conn (Define "person" (attributesFromList [Attribute "name" StringAtomType, Attribute "age" IntAtomType, Attribute "id" StringAtomType]))
27```
283. Execute a transaction graph expression
29```haskell
30maybeErr <- executeGraphExpr conn (JumpToHead "branch2")
31```
33## Cleanup
351. Close the connection
36```haskell
37close conn