The integration of GLORP with Squeak is completely hardcoded with PostgreSQL driver.
We has stated with the SqueakDBX/Glorp integration. Our intention is to make a refactor over glorp that will permit the background compatibility and support different drivers. So, if you want to use SqueakDBX in an actual Glorp application, it will have no problems. You will be able to replace the native driver with SqueakDBX driver, in a quickly and easy way. We invited Alan Night to have dinner with us when he came to Argentina. We told him our ideas and discuss for a while till we get a first design of this refactor.

Our solution is create an abstract layer to uncoupling the native Driver. The Next image is the our refactor to GLORP. You can see, that DatabaseDriver is the new layer charged of this. Then, It has two implementations. First, the native driver implementation (NativePosgresDriver) and second the squeakDBX implementation (SqueakDBXDriver).

To load Glorp with the native PostgreSQL driver you must evaluate:
Installer ss
project: ’Glorp’;
install: ’GlorpPharoLoader’.
And then evaluate:
GlorpPharoLoader loadGlorpWithNativePostgreSQLDriver
You can also install GlorpDBX. This will apply the path to support underscore in selectors, load Glorp and the GlorpPharoAdaptor. Then it will apply the path to Glorp to support different database drivers (our refactor) and will load the SqueakDBX Glorp Driver and also will load SqueakDBX and FFI. You don’t nee to explicitly download SqueakDBX in this case.
Installer ss
project: ’SqueakDBX’;
install: ’SqueakDBXPharoLoader’.
And then evaluate:
SqueakDBXPharoLoader loadGlorpDBX
You have to modify the DBXGlorpBackendFacility class deppending on the driver to test. There is a facility to each driver. You can change the configuration parameters in the class methods:
For Example:
login := (Login new)
database: PostgreSQLPlatform new;
username: ’sodbxtest’;
password: ’sodbxtest’;
connectString: ’127.0.0.1_sodbxtest’.
You must change username and password and the connectring. The connectString is the IP with the database name. It continous on this way because we decided to respect the background compatibility with Glorp.
Then, open a Test Runner and execute the test of:
if you want execute Glorp Test using PostgreSQL Native Driver.
if you want execute Glorp Test using OpenDBX Driver to PostgreSQL.
if you want execute Glorp Test using OpenDBX Driver to Oracle.
Then, just execute the Glorp Test.
Common Problems
May be, All Glorp Test will fail at first execution. It is very possible that Glorp did not create the TABLES into the database. So, you can force to do this. We have a test in GlorpDBX that create all TABLES needed to execute the Glorp Test. Please, execute DBXGlorpQueryDMLTest with Test runner. You do not forget to execute the Test that set the Facility. (Previous subject)
We have in mind that we would prefer to finish the SqueakDBX development to PostgreSQL, running all Glorp test successfully and then we will started with others backends link oracle, mysql, MS SQL Server, ODBC and Sqlite.