Skip to content

Commit

Permalink
Merge pull request #51 from feenkcom/master
Browse files Browse the repository at this point in the history
Updates from feenk
  • Loading branch information
svenvc authored Mar 7, 2024
2 parents 769ed55 + 16c4cc5 commit 3577400
Showing 1 changed file with 29 additions and 11 deletions.
40 changes: 29 additions & 11 deletions P3/P3Client.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,22 @@ P3Client >> clearTextPasswordMessage [
P3Client >> close [
"Cleanly close my connection with the server"

connection
ifNotNil: [
[
self logDisconnecting.
self writeMessage: #[] tag: $X.
connection close ] on: Error do: [ ].
self clearSession.
connection := nil ]
connection ifNotNil: [
[
self writeMessage: #[] tag: $X.
connection close ] on: Error do: [ ].
self clearSession.
connection := nil.
self logDisconnected ]
]

{ #category : #accessing }
P3Client >> compactUrl [
^ self url
scheme: #psql;
password: nil;
queryRemoveAll;
yourself
]

{ #category : #public }
Expand Down Expand Up @@ -514,7 +522,7 @@ P3Client >> logConnected [
]

{ #category : #'private - logging' }
P3Client >> logDisconnecting [
P3Client >> logDisconnected [
(self newLogEvent: P3ConnectionClosedEvent)
emit
]
Expand Down Expand Up @@ -720,11 +728,16 @@ P3Client >> preparedStatementNamed: name [
P3Client >> printOn: stream [
super printOn: stream.
stream nextPut: $(.
stream print: self url.
self session ifNotNil: [ stream space; print: session ].
self printStateOn: stream.
stream nextPut: $)
]

{ #category : #printing }
P3Client >> printStateOn: stream [
stream print: self compactUrl.
self session ifNotNil: [ stream space; print: session ]
]

{ #category : #private }
P3Client >> processBackendKeyData: payload [
session := payload uint32.
Expand Down Expand Up @@ -1104,6 +1117,11 @@ P3Client >> startupOptions: optionsString [
settings at: #options put: optionsString
]

{ #category : #printing }
P3Client >> statePrintString [
^ String streamContents: [ :out | self printStateOn: out ]
]

{ #category : #accessing }
P3Client >> timeout [
"Return the timeout in seconds I (want to) use, the default being 10 seconds."
Expand Down

0 comments on commit 3577400

Please sign in to comment.