Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/bytea/bytea-example.pony
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ actor Client is (SessionStatusNotify & ResultReceiver)
_out.print("Failed to authenticate.")

be pg_query_result(session: Session, result: Result) =>
match result
match \exhaustive\ result
| let r: ResultSet =>
_out.print("ResultSet (" + r.rows().size().string() + " rows):")
for row in r.rows().values() do
for field in row.fields.values() do
_out.write(field.name + "=")
match field.value
match \exhaustive\ field.value
| let v: Array[U8] val =>
_out.print(v.size().string() + " bytes")
// Print each byte's decimal value
Expand Down
2 changes: 1 addition & 1 deletion examples/cancel/cancel-example.pony
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ actor Client is (SessionStatusNotify & ResultReceiver)
be pg_query_failed(session: Session, query: Query,
failure: (ErrorResponseMessage | ClientQueryError))
=>
match failure
match \exhaustive\ failure
| let err: ErrorResponseMessage =>
if err.code == "57014" then
_out.print("Query was cancelled (SQLSTATE 57014).")
Expand Down
10 changes: 5 additions & 5 deletions examples/copy-in/copy-in-example.pony
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ actor Client is (SessionStatusNotify & ResultReceiver & CopyInReceiver)
be pg_copy_failed(session: Session,
failure: (ErrorResponseMessage | ClientQueryError))
=>
match failure
match \exhaustive\ failure
| let e: ErrorResponseMessage =>
_out.print("COPY failed: [" + e.severity + "] " + e.code + ": "
+ e.message)
Expand All @@ -85,7 +85,7 @@ actor Client is (SessionStatusNotify & ResultReceiver & CopyInReceiver)
be pg_query_result(session: Session, result: Result) =>
_phase = _phase + 1

match _phase
match \exhaustive\ _phase
| 1 =>
// Table dropped (or didn't exist). Create it.
_out.print("Creating table...")
Expand All @@ -105,14 +105,14 @@ actor Client is (SessionStatusNotify & ResultReceiver & CopyInReceiver)
"COPY copy_in_example (name, value) FROM STDIN", this)
| 3 =>
// SELECT done. Print results and drop table.
match result
match \exhaustive\ result
| let r: ResultSet =>
_out.print("ResultSet (" + r.rows().size().string() + " rows):")
for row in r.rows().values() do
_out.write(" ")
for field in row.fields.values() do
_out.write(" " + field.name + "=")
match field.value
match \exhaustive\ field.value
| let v: String => _out.write(v)
| let v: I32 => _out.write(v.string())
| None => _out.write("NULL")
Expand All @@ -133,7 +133,7 @@ actor Client is (SessionStatusNotify & ResultReceiver & CopyInReceiver)
be pg_query_failed(session: Session, query: Query,
failure: (ErrorResponseMessage | ClientQueryError))
=>
match failure
match \exhaustive\ failure
| let e: ErrorResponseMessage =>
_out.print("Query failed: [" + e.severity + "] " + e.code + ": "
+ e.message)
Expand Down
6 changes: 3 additions & 3 deletions examples/copy-out/copy-out-example.pony
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ actor Client is (SessionStatusNotify & ResultReceiver & CopyOutReceiver)
be pg_copy_failed(session: Session,
failure: (ErrorResponseMessage | ClientQueryError))
=>
match failure
match \exhaustive\ failure
| let e: ErrorResponseMessage =>
_out.print("COPY failed: [" + e.severity + "] " + e.code + ": "
+ e.message)
Expand All @@ -76,7 +76,7 @@ actor Client is (SessionStatusNotify & ResultReceiver & CopyOutReceiver)
be pg_query_result(session: Session, result: Result) =>
_phase = _phase + 1

match _phase
match \exhaustive\ _phase
| 1 =>
// Table dropped (or didn't exist). Create it.
_out.print("Creating table...")
Expand Down Expand Up @@ -111,7 +111,7 @@ actor Client is (SessionStatusNotify & ResultReceiver & CopyOutReceiver)
be pg_query_failed(session: Session, query: Query,
failure: (ErrorResponseMessage | ClientQueryError))
=>
match failure
match \exhaustive\ failure
| let e: ErrorResponseMessage =>
_out.print("Query failed: [" + e.severity + "] " + e.code + ": "
+ e.message)
Expand Down
10 changes: 5 additions & 5 deletions examples/crud/crud-example.pony
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ actor Client is (SessionStatusNotify & ResultReceiver)
be pg_query_result(session: Session, result: Result) =>
_phase = _phase + 1

match _phase
match \exhaustive\ _phase
| 1 =>
// Table dropped (or didn't exist). Create it.
_out.print("Creating table...")
Expand Down Expand Up @@ -89,14 +89,14 @@ actor Client is (SessionStatusNotify & ResultReceiver)
this)
| 5 =>
// Select done. Print results and delete all rows.
match result
match \exhaustive\ result
| let r: ResultSet =>
_out.print("ResultSet (" + r.rows().size().string() + " rows):")
for row in r.rows().values() do
_out.write(" ")
for field in row.fields.values() do
_out.write(" " + field.name + "=")
match field.value
match \exhaustive\ field.value
| let v: String => _out.write(v)
| let v: I16 => _out.write(v.string())
| let v: I32 => _out.write(v.string())
Expand Down Expand Up @@ -128,15 +128,15 @@ actor Client is (SessionStatusNotify & ResultReceiver)
end

fun _print_row_modifying(result: Result) =>
match result
match \exhaustive\ result
| let r: RowModifying =>
_out.print(r.command() + " " + r.impacted().string() + " rows")
end

be pg_query_failed(session: Session, query: Query,
failure: (ErrorResponseMessage | ClientQueryError))
=>
match failure
match \exhaustive\ failure
| let e: ErrorResponseMessage =>
_out.print("Query failed: [" + e.severity + "] " + e.code + ": "
+ e.message)
Expand Down
4 changes: 2 additions & 2 deletions examples/listen-notify/listen-notify-example.pony
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ actor Client is (SessionStatusNotify & ResultReceiver)
be pg_query_result(session: Session, result: Result) =>
_phase = _phase + 1

match _phase
match \exhaustive\ _phase
| 1 =>
// LISTEN done, send notification
_out.print("Subscribed. Sending notification...")
Expand All @@ -69,7 +69,7 @@ actor Client is (SessionStatusNotify & ResultReceiver)
be pg_query_failed(session: Session, query: Query,
failure: (ErrorResponseMessage | ClientQueryError))
=>
match failure
match \exhaustive\ failure
| let e: ErrorResponseMessage =>
_out.print("Query failed: [" + e.severity + "] " + e.code + ": "
+ e.message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ actor Client is (SessionStatusNotify & ResultReceiver & PrepareReceiver)
close()

be pg_query_result(session: Session, result: Result) =>
match result
match \exhaustive\ result
| let r: ResultSet =>
_out.print("ResultSet (" + r.rows().size().string() + " rows):")
for row in r.rows().values() do
for field in row.fields.values() do
_out.write(" " + field.name + "=")
match field.value
match \exhaustive\ field.value
| let v: String => _out.print(v)
| let v: I16 => _out.print(v.string())
| let v: I32 => _out.print(v.string())
Expand Down
2 changes: 1 addition & 1 deletion examples/notice/notice-example.pony
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ actor Client is (SessionStatusNotify & ResultReceiver)
be pg_query_failed(session: Session, query: Query,
failure: (ErrorResponseMessage | ClientQueryError))
=>
match failure
match \exhaustive\ failure
| let e: ErrorResponseMessage =>
_out.print("Query failed: [" + e.severity + "] " + e.code + ": "
+ e.message)
Expand Down
2 changes: 1 addition & 1 deletion examples/parameter-status/parameter-status-example.pony
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ actor Client is (SessionStatusNotify & ResultReceiver)
be pg_query_failed(session: Session, query: Query,
failure: (ErrorResponseMessage | ClientQueryError))
=>
match failure
match \exhaustive\ failure
| let e: ErrorResponseMessage =>
_out.print("Query failed: [" + e.severity + "] " + e.code + ": "
+ e.message)
Expand Down
4 changes: 2 additions & 2 deletions examples/prepared-query/prepared-query-example.pony
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ actor Client is (SessionStatusNotify & ResultReceiver)
_out.print("Failed to authenticate.")

be pg_query_result(session: Session, result: Result) =>
match result
match \exhaustive\ result
| let r: ResultSet =>
_out.print("ResultSet (" + r.rows().size().string() + " rows):")
for row in r.rows().values() do
for field in row.fields.values() do
_out.write(" " + field.name + "=")
match field.value
match \exhaustive\ field.value
| let v: String => _out.print(v)
| let v: I16 => _out.print(v.string())
| let v: I32 => _out.print(v.string())
Expand Down
4 changes: 2 additions & 2 deletions examples/query/query-example.pony
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ actor Client is (SessionStatusNotify & ResultReceiver)
_out.print("Failed to authenticate.")

be pg_query_result(session: Session, result: Result) =>
match result
match \exhaustive\ result
| let r: ResultSet =>
_out.print("ResultSet (" + r.rows().size().string() + " rows):")
for row in r.rows().values() do
for field in row.fields.values() do
_out.write(field.name + "=")
match field.value
match \exhaustive\ field.value
| let v: String => _out.print(v)
| let v: I16 => _out.print(v.string())
| let v: I32 => _out.print(v.string())
Expand Down
4 changes: 2 additions & 2 deletions examples/ssl-preferred-query/ssl-preferred-query-example.pony
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ actor Client is (SessionStatusNotify & ResultReceiver)
_out.print("Failed to authenticate.")

be pg_query_result(session: Session, result: Result) =>
match result
match \exhaustive\ result
| let r: ResultSet =>
_out.print("ResultSet (" + r.rows().size().string() + " rows):")
for row in r.rows().values() do
for field in row.fields.values() do
_out.write(field.name + "=")
match field.value
match \exhaustive\ field.value
| let v: String => _out.print(v)
| let v: I16 => _out.print(v.string())
| let v: I32 => _out.print(v.string())
Expand Down
4 changes: 2 additions & 2 deletions examples/ssl-query/ssl-query-example.pony
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ actor Client is (SessionStatusNotify & ResultReceiver)
_out.print("Failed to authenticate.")

be pg_query_result(session: Session, result: Result) =>
match result
match \exhaustive\ result
| let r: ResultSet =>
_out.print("ResultSet (" + r.rows().size().string() + " rows):")
for row in r.rows().values() do
for field in row.fields.values() do
_out.write(field.name + "=")
match field.value
match \exhaustive\ field.value
| let v: String => _out.print(v)
| let v: I16 => _out.print(v.string())
| let v: I32 => _out.print(v.string())
Expand Down
6 changes: 3 additions & 3 deletions examples/streaming/streaming-example.pony
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ actor Client is
be pg_query_failed(session: Session, query: Query,
failure: (ErrorResponseMessage | ClientQueryError))
=>
match failure
match \exhaustive\ failure
| let e: ErrorResponseMessage =>
_out.print("Query failed: [" + e.severity + "] " + e.code + ": "
+ e.message)
Expand All @@ -101,7 +101,7 @@ actor Client is
_out.write(" ")
for field in row.fields.values() do
_out.write(" " + field.name + "=")
match field.value
match \exhaustive\ field.value
| let v: String => _out.write(v)
| let v: I32 => _out.write(v.string())
| None => _out.write("NULL")
Expand All @@ -122,7 +122,7 @@ actor Client is
query: (PreparedQuery | NamedPreparedQuery),
failure: (ErrorResponseMessage | ClientQueryError))
=>
match failure
match \exhaustive\ failure
| let e: ErrorResponseMessage =>
_out.print("Stream failed: [" + e.severity + "] " + e.code + ": "
+ e.message)
Expand Down
6 changes: 3 additions & 3 deletions examples/transaction-status/transaction-status-example.pony
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ actor Client is (SessionStatusNotify & ResultReceiver)
_out.print("Failed to authenticate.")

be pg_transaction_status(session: Session, status: TransactionStatus) =>
match status
match \exhaustive\ status
| TransactionIdle => _out.print("Transaction status: idle")
| TransactionInBlock => _out.print("Transaction status: in transaction")
| TransactionFailed => _out.print("Transaction status: failed")
Expand All @@ -50,7 +50,7 @@ actor Client is (SessionStatusNotify & ResultReceiver)
be pg_query_result(session: Session, result: Result) =>
_phase = _phase + 1

match _phase
match \exhaustive\ _phase
| 1 =>
// BEGIN done. Commit to return to idle.
_session.execute(SimpleQuery("COMMIT"), this)
Expand All @@ -63,7 +63,7 @@ actor Client is (SessionStatusNotify & ResultReceiver)
be pg_query_failed(session: Session, query: Query,
failure: (ErrorResponseMessage | ClientQueryError))
=>
match failure
match \exhaustive\ failure
| let e: ErrorResponseMessage =>
_out.print("Query failed: [" + e.severity + "] " + e.code + ": "
+ e.message)
Expand Down
2 changes: 1 addition & 1 deletion postgres/_authentication_failure_reason.pony
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ primitive InvalidPassword

primitive ServerVerificationFailed
"""
The server's SCRAM signature did not match the expected value. This may
The server's SCRAM signature did not match \exhaustive\ the expected value. This may
indicate a man-in-the-middle attack or a misconfigured server.
"""

Expand Down
4 changes: 2 additions & 2 deletions postgres/_cancel_sender.pony
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ actor _CancelSender is (lori.TCPConnectionActor & lori.ClientLifecycleEventRecei
_tcp_connection

fun ref _on_connected() =>
match _info.ssl_mode
match \exhaustive\ _info.ssl_mode
| SSLDisabled =>
_send_cancel_and_close()
| let _: (SSLRequired | SSLPreferred) =>
Expand All @@ -52,7 +52,7 @@ actor _CancelSender is (lori.TCPConnectionActor & lori.ClientLifecycleEventRecei
_tcp_connection.close()
return
end
match _tcp_connection.start_tls(ctx, _info.host)
match \exhaustive\ _tcp_connection.start_tls(ctx, _info.host)
| None => None // Handshake started, wait for _on_tls_ready
| let _: lori.StartTLSError =>
_tcp_connection.close()
Expand Down
2 changes: 1 addition & 1 deletion postgres/_frontend_message.pony
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ primitive _FrontendMessage
end
offset = offset + 2
for p in params.values() do
match p
match \exhaustive\ p
| let s: String =>
ifdef bigendian then
msg.update_u32(offset, s.size().u32())?
Expand Down
4 changes: 2 additions & 2 deletions postgres/_test_cancel.pony
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ actor \nodoc\ _SSLCancelTestServer
// SSLRequest — respond 'S' and upgrade to TLS
let response: Array[U8] val = ['S']
_tcp_connection.send(response)
match _tcp_connection.start_tls(_sslctx)
match \exhaustive\ _tcp_connection.start_tls(_sslctx)
| None => _ssl_started = true
| let _: lori.StartTLSError =>
_tcp_connection.close()
Expand Down Expand Up @@ -450,7 +450,7 @@ actor \nodoc\ _CancelPgSleepClient is
return
end

match failure
match \exhaustive\ failure
| let err: ErrorResponseMessage =>
if err.code == "57014" then
_h.complete(true)
Expand Down
2 changes: 1 addition & 1 deletion postgres/_test_copy_out.pony
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ actor \nodoc\ _CopyOutExportTestClient is
be pg_query_failed(session: Session, query: Query,
failure: (ErrorResponseMessage | ClientQueryError))
=>
match failure
match \exhaustive\ failure
| let e: ErrorResponseMessage =>
_h.fail("Query failed: " + e.code + ": " + e.message)
| let e: ClientQueryError =>
Expand Down
2 changes: 1 addition & 1 deletion postgres/_test_equality.pony
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use "pony_test"
class \nodoc\ iso _TestFieldEqualityReflexive is UnitTest
"""
Every FieldDataTypes variant produces a Field that is equal to itself.
Covers all 9 variants of the FieldDataTypes union to verify each match
Covers all 9 variants of the FieldDataTypes union to verify each match \exhaustive\
branch in Field.eq.
"""
fun name(): String => "Field/Equality/Reflexive"
Expand Down
Loading