Glorp

Glorp is the Object-Relational-Mapper for Smalltalk. More on glorp will be added in the future.

The current version is not adapted yet with garage. Glorp adaptors exist for Postgres and OpenDBX (in their corresponding groups in the configuration download), Sqlite3 and Mysql.

Installation

Current glorp's version is version 1.10, for Pharo 3.0 and 4.0. You can load glorp using its metacello configuration. For that, execute the following script.

Gofer it
	smalltalkhubUser: 'DBXTalk' project: 'Glorp';
	configurationOf: 'Glorp';
	loadVersion: '1.10'.

As glorp works with many different database drivers, this configuration does not include a database driver. Database drivers are loadable separately from glorp. We explain how to load the existent glorp drivers in following subsections.

1. Garage Glorp driver

Version 0.1 of GarageGlorp requires version 0.2 of garage or superior.

The GarageGlorp package includes a Glorp driver using Garage. Current version of GarageGlorp driver is 0.1, and is available as a metacello configuration that can be loaded with the following script.

Gofer it
	smalltalkhubUser: 'DBXTalk' project: 'Garage';
	configurationOf: 'GarageGlorp';
	loadVersion: '0.1'.

This configuration will take care of loading the correct version of glorp. That is, there is no need to load Glorp separately. You will have however to load the particular garage driver of your choice. For example, you can load Glorp and Garage's postgresV2 driver using the following script:

Gofer it
	smalltalkhubUser: 'DBXTalk' project: 'Garage';
	configurationOf: 'GarageGlorp';
	loadVersion: '0.1'.
Gofer it
	smalltalkhubUser: 'DBXTalk' project: 'Garage';
	configurationOf: 'Garage';
	load.
(ConfigurationOfGarage project version: '0.2') load: #postgresqlV2.

To configure glorp to use this driver, you should execute the following expression:

GAGlorpDriver beGlorpDefaultDriver.

2. PostgresV2 Glorp driver

You can use glorp outside of Garage with the native Postgresql driver. You can load it by doing:

Gofer it
	smalltalkhubUser: 'DBXTalk' project: 'Configurations';
	configurationOf: 'GlorpDBX';
	load.
(#ConfigurationOfGlorpDBX asClass project version:'2.9') load: 'GlorpPostgresV2Native'

3. Mysql Glorp driver

You can use glorp outside of Garage with the native mysql driver. You can load it by doing:

Gofer new
	smalltalkhubUser: 'ThomasHeniart' project: 'GlorpDriverMySQL';
	configurationOf: 'GlorpDriverMySQL';
	loadVersion: #bleedingEdge.

NativeMysqlDriver beGlorpDefaultDriver.

4. NBSqlite3 Glorp driver

Glorp is also compatible with the NBSqlite3 driver. Documentation for loading and using such driver can be found in the smalltalkhub page of the project.

5. Documentation and resources

The following list of resources include tutorials and other documentations explaining how to use glorp.