Try this:
| sql conn connectionSpec result |
sql := 'SELECT * FROM search_terms'.
conn := GAConnection new.
connectionSpec := GAConnectionArgs
hostname: 'localhost'
portno: 5432
databaseName: 'sodbxtest'
userName: 'sodbxtest'
password: 'sodbxtest'.
conn connectionArgs: connectionSpec.
"Connect to the server"
result := conn startup.
(result errorResponse isKindOf: GAErrorResponse) ifTrue: [ self halt ].
"Execute your SQL stuff"
result := conn execute: sql.
(result errorResponse isKindOf: GAErrorResponse) ifTrue: [ self halt ] ifFalse: [result inspect].
"Disconnect from the server"
conn close.
-----------------
Beno��t St-Jean
Yahoo! Messenger: bstjean
Twitter: @BenLeChialeux
Pinterest: benoitstjean
Instagram: Chef_Benito
IRC: lamneth
Blogue: endormitoire.wordpress.com
"A standpoint is an intellectual horizon of radius zero". (A. Einstein)
From: Dimitris Chloupis <kilon.alios@gmail.com>
To: Benoit St-Jean <bstjean@yahoo.com>; Any question about pharo is welcome <pharo-users@lists.pharo.org>
Sent: Monday, April 17, 2017 5:24 PM
Subject: Re: [Pharo-users] PostgreSQL and Pharo 6
Following the instructions here
http://guillep.github.io/DBXTalk/garage/installation.htmlI did
Gofer it
smalltalkhubUser: 'DBXTalk' project: 'Garage';
configurationOf: 'Garage';
load.
(ConfigurationOfGarage project version: '0.5')
load: 'postgresV2'.
And it did install
Tell me which exact package you loaded (or even better, the exact to load it) and I will test some code against my PostgreSQL server...
-----------------
Beno��t St-Jean
Yahoo! Messenger: bstjean
Twitter: @BenLeChialeux
Pinterest: benoitstjean
Instagram: Chef_Benito
IRC: lamneth
Blogue:
endormitoire.wordpress.com
"A standpoint is an intellectual horizon of radius zero". (A. Einstein)
Sent: Monday, April 17, 2017 4:55 PM
Subject: Re: [Pharo-users] PostgreSQL and Pharo 6
no conn connect does not work because GAConnection has no such method.
#connect exist in GAPostgresDrive but even if I go that route I get error #OptionAt:IfAbsent: was sent to nil . With this code
conn2 := GAPostgresDriver new .
port: '****'
database:'*******'
user: '*****'
password:''***'.
conn2 connect.
Is there sample code that connects to online databases ?
You have to #connect before executing SQL statements!
Something like (in your code):
conn connect.
-----------------
Beno��t St-Jean
Yahoo! Messenger: bstjean
Twitter: @BenLeChialeux
Pinterest: benoitstjean
Instagram: Chef_Benito
IRC: lamneth
Blogue:
endormitoire.wordpress.com
"A standpoint is an intellectual horizon of radius zero". (A. Einstein)
Installing from Catalog Browser fails
I installed it via the the website instructions, it installs fine
But if I use it this way
conn := GAConnection new.
portno: '****'
databaseName:'*******'
userName: '*****'
password:''***'.
conn connectionArgs: ca.
conn execute: 'select * from search_terms'.
it fails with no connection, is there anything else i need to do ?
is there a guide for how to use this ?
thank you Benoit
ODBC worked fine as well if you don't need native driver acc
ess
-----------------
Beno��t St-Jean
Yahoo! Messenger: bstjean
Twitter: @BenLeChialeux
Pinterest: benoitstjean
Instagram: Chef_Benito
IRC: lamneth
Blogue:
endormitoire.wordpress.com
"A standpoint is an intellectual horizon of radius zero". (A. Einstein)
Hey guys , I play with PostgreSQL and I really like it, sorry Esteban :D
I am using Python for it but I would like to give access also to Pharo to my database. I was informed that Garage has a driver for PostgreSQL , is there any other candidate ? Any advice ?