Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Startup options added to P3Client #49

Merged
merged 2 commits into from
Feb 18, 2024
Merged
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
17 changes: 16 additions & 1 deletion P3/P3Client.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -1088,9 +1088,22 @@ P3Client >> startupMessage [
self database ifNotNil: [
out nextPutAll: (self asCString: 'database').
out nextPutAll: (self asCString: self database) ].
self startupOptions ifNotNil: [
out nextPutAll: (self asCString: 'options').
out nextPutAll: (self asCString: self startupOptions) ].
out nextPut: 0 ]
]

{ #category : #accessing }
P3Client >> startupOptions [
^ settings at: #options ifAbsent: [ nil ]
]

{ #category : #accessing }
P3Client >> startupOptions: optionsString [
settings at: #options put: optionsString
]

{ #category : #accessing }
P3Client >> timeout [
"Return the timeout in seconds I (want to) use, the default being 10 seconds."
Expand Down Expand Up @@ -1155,6 +1168,7 @@ P3Client >> url [
password: self password ].
self database ifNotNil: [ url addPathSegment: self database ].
self isSSL ifTrue: [ url queryAt: #sslmode put: #require ].
self startupOptions ifNotNil: [ :options | url queryAt: #options put: options ].
^ url
]

Expand All @@ -1181,7 +1195,8 @@ P3Client >> url: stringOrUrl [
password: url password ].
self database: url firstPathSegment.
(url queryAt: #sslmode ifAbsent: [ #disable ]) = #require
ifTrue: [ self setSSL ]
ifTrue: [ self setSSL ].
url queryAt: #options ifPresent: [ :options | self startupOptions: options ]
]

{ #category : #accessing }
Expand Down
Loading