-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathresult.pony
More file actions
73 lines (60 loc) · 1.57 KB
/
result.pony
File metadata and controls
73 lines (60 loc) · 1.57 KB
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
trait val Result
"""
The result of a successfully executed query. Subtypes distinguish between
queries that return rows (`ResultSet`), queries that modify rows
(`RowModifying`), and queries that do neither (`SimpleResult`).
"""
fun query(): Query
class val ResultSet is Result
"""
A query result containing rows. Returned for SELECT and other row-returning
statements. Provides access to the returned `Rows` and the command tag
string (e.g., "SELECT").
"""
let _query: Query
let _rows: Rows
let _command: String
new val create(query': Query,
rows': Rows,
command': String)
=>
_query = query'
_rows = rows'
_command = command'
fun query(): Query =>
_query
fun rows(): Rows =>
_rows
fun command(): String =>
_command
class val SimpleResult is Result
"""
A query result for statements that return no rows and report no row count.
Returned for empty queries (the `EmptyQueryResponse` case).
"""
let _query: Query
new val create(query': Query) =>
_query = query'
fun query(): Query =>
_query
class val RowModifying is Result
"""
A query result for statements that modify rows (INSERT, UPDATE, DELETE).
Provides the command tag string and the number of rows affected.
"""
let _query: Query
let _command: String
let _impacted: USize
new val create(query': Query,
command': String,
impacted': USize)
=>
_query = query'
_command = command'
_impacted = impacted'
fun query(): Query =>
_query
fun command(): String =>
_command
fun impacted(): USize =>
_impacted