Skip to content

Latest commit

 

History

History
37 lines (29 loc) · 1.1 KB

projectm36_client_library.markdown

File metadata and controls

37 lines (29 loc) · 1.1 KB

Project:M36 Client Library

The 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.

The client supports both in-process and remote Project:M36 access.

Setup

  1. Import the library's symbols
import ProjectM36.Client
  1. Create a Connection with a ConnectionInfo in the Either monad
conn <- connectProjectM36 (InProcessConnectionInfo NoPersistence)

Executing Expressions

  1. Execute relational expression queries
result <- executeRelationalExpr conn (Union (RelationVariable "x") (RelationVariable "y"))
  1. Execute database context expressions which modify the current, mutable database context
maybeErr <- executeDatabaseContextExpr conn (Define "person" (attributesFromList [Attribute "name" StringAtomType, Attribute "age" IntAtomType, Attribute "id" StringAtomType]))
  1. Execute a transaction graph expression
maybeErr <- executeGraphExpr conn (JumpToHead "branch2")

Cleanup

  1. Close the connection
close conn