forked from typedb/typedb-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsession.yml
126 lines (126 loc) · 3.43 KB
/
session.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
title: "Session"
methods:
- method:
common: &method-transaction
title: Open a transaction
description: Opens a transaction to perform read or write queries on the database connected to the session.
accepts:
param1:
name: transactionType
type: Transaction.Type
description: The type of transaction to be created (READ or WRITE).
required: true
param2:
name: options
description: Options for the session.
type: "[`TypeDBOptions`](#options)"
required: false
default: N/A
returns:
- "[Transaction](#transaction)"
java:
<<: *method-transaction
method: session.transaction(Transaction.Type transactionType, TypeDBOptions options);
python:
<<: *method-transaction
method: session.transaction(transaction_type, options)
- method:
javascript:
title: Open a transaction
description: Opens a transaction to perform read or write queries on the database connected to the session.
accepts:
param1:
name: transactionType
type: Transaction.Type
description: The type of transaction to be created (READ or WRITE).
required: true
param2:
name: options
description: Options for the session.
type: "[`TypeDBOptions`](#options)"
required: false
default: N/A
returns:
- "[Transaction](#transaction)"
method: await session.transaction(transactionType, options);
- method:
common: &method-isopen
title: Check if a session is open
description: |
Checks whether a session is presently open.
java:
<<: *method-isopen
method: session.isOpen();
returns:
- boolean
javascript:
<<: *method-isopen
method: await session.isOpen();
returns:
- boolean
python:
<<: *method-isopen
method: session.is_open()
returns:
- boolean
- method:
common: &method-type
title: Check the session's type
description: |
Checks the current session's type (SCHEMA or DATA)
java:
<<: *method-type
method: session.type();
returns:
- Session.Type
javascript:
<<: *method-type
method: session.type;
returns:
- SessionType
python:
<<: *method-type
method: session.session_type()
returns:
- SessionType
- method:
common: &method-database
title: Check the session's database
description: |
Returns a string indicating what database the session is operating over.
java:
<<: *method-database
method: session.database();
returns:
- String
javascript:
<<: *method-database
method: session.database();
returns:
- String
python:
<<: *method-database
method: session.database()
returns:
- String
- method:
common: &method-close
title: Close a session
description: |
Closes the session.
**Before opening a new session, the session currently open should first be closed.**
java:
<<: *method-close
method: session.close();
returns:
- void
javascript:
<<: *method-close
method: await session.close();
returns:
- void
python:
<<: *method-close
method: session.close()
returns:
- None