pharo-users@lists.pharo.org

Any question about pharo is welcome

View all threads

Pharo9 GLORP + MySQL

LS
laszlo.szolnoki@gmail.com
Wed, Dec 22, 2021 8:33 PM

Hi, I’m new to the Pharo users mailing list and to Pharo in general, too.

My goal is to make a CRUD web application using Seaside, Magritte, GLORP and MariaDB (MySQL-like RDBMS).

I already test-drove GLORP with PostgreSQL-P3, with success.

But I need MariaDB because it implements SQL:2011 (which Postgres lacks currently) thus enabling the use of system-versioned and bi-temporal tables.

Currently I don’t need GLORP to handle any of the SQL:2011 features as the versioning would be invisible to the web app, it is needed only for auditing purposes.

I tried to make the system work be installing the MySQL driver into a fresh Pharo9 image:

Metacello new
repository: 'github://pharo-rdbms/Pharo-MySQL';
baseline: 'MySQL';
load

Since the package 'MySQL-Glorp' didn't load, I installed it manually from github. (Sorry but I'm noob to work with baselines, Iceberg, Monticello and such.)

Then loaded GLORP:
Metacello new
repository: 'github://pharo-rdbms/glorp';
baseline: 'Glorp';
load.

Then I tried to do everything in a similar manner to how I did it with P3:

login := Login new
database: MySQLPlatform new;
username: 'root';
password: '****';
host: '<my host>';
port: '3306';
databaseName: 'test'.

accessor := DatabaseAccessor forLogin: login.
accessor login.
accessor isLoggedIn. >>> true

Yay, very nice.
Then:

session := GlorpBookDescriptorSystem sessionForLogin: login.

*GlorpBookDescriptorSystem is subclass of DescriptorSystem. It comes from the demo from pharobooks with an example on how to use GLORP with P3. It contains the demo class models, descriptors and table definitions.

And finally:
session login. >>> Instance of MySQLDriver did not understand #queryEncoding
:(

Any hints appreciated.

Hi, I’m new to the Pharo users mailing list and to Pharo in general, too. My goal is to make a CRUD web application using Seaside, Magritte, GLORP and MariaDB (MySQL-like RDBMS). I already test-drove GLORP with PostgreSQL-P3, with success. But I need MariaDB because it implements SQL:2011 (which Postgres lacks currently) thus enabling the use of system-versioned and bi-temporal tables. Currently I don’t need GLORP to handle any of the SQL:2011 features as the versioning would be invisible to the web app, it is needed only for auditing purposes. I tried to make the system work be installing the MySQL driver into a fresh Pharo9 image: Metacello new repository: 'github://pharo-rdbms/Pharo-MySQL'; baseline: 'MySQL'; load Since the package 'MySQL-Glorp' didn't load, I installed it manually from github. (Sorry but I'm noob to work with baselines, Iceberg, Monticello and such.) Then loaded GLORP: Metacello new repository: 'github://pharo-rdbms/glorp'; baseline: 'Glorp'; load. Then I tried to do everything in a similar manner to how I did it with P3: login := Login new database: MySQLPlatform new; username: 'root'; password: '\*\*\*\*'; host: '<my host>'; port: '3306'; databaseName: 'test'. accessor := DatabaseAccessor forLogin: login. accessor login. accessor isLoggedIn. >>> true Yay, very nice. Then: session := GlorpBookDescriptorSystem sessionForLogin: login. \*GlorpBookDescriptorSystem is subclass of DescriptorSystem. It comes from the demo from pharobooks with an example on how to use GLORP with P3. It contains the demo class models, descriptors and table definitions. And finally: session login. >>> Instance of MySQLDriver did not understand #queryEncoding \:( Any hints appreciated.
JA
John Aspinall
Thu, Dec 23, 2021 10:28 AM

Hi - I can’t help with your GLORP query but you may find ReStore a viable alternative, particularly if you're starting with a new database:

https://github.com/rko281/ReStoreForPharo https://github.com/rko281/ReStoreForPharo

I’ve just checked and the MySQL/MariaDB connector is working in both Pharo 9 and 10.

Cheers.

John Aspinall

On 22 Dec 2021, at 20:33, laszlo.szolnoki@gmail.com wrote:

Hi, I’m new to the Pharo users mailing list and to Pharo in general, too.

My goal is to make a CRUD web application using Seaside, Magritte, GLORP and MariaDB (MySQL-like RDBMS).

I already test-drove GLORP with PostgreSQL-P3, with success.

But I need MariaDB because it implements SQL:2011 (which Postgres lacks currently) thus enabling the use of system-versioned and bi-temporal tables.

Currently I don’t need GLORP to handle any of the SQL:2011 features as the versioning would be invisible to the web app, it is needed only for auditing purposes.

I tried to make the system work be installing the MySQL driver into a fresh Pharo9 image:

Metacello new repository: 'github://pharo-rdbms/Pharo-MySQL'; baseline: 'MySQL'; load Since the package 'MySQL-Glorp' didn't load, I installed it manually from github. (Sorry but I'm noob to work with baselines, Iceberg, Monticello and such.) Then loaded GLORP: Metacello new repository: 'github://pharo-rdbms/glorp'; baseline: 'Glorp'; load. Then I tried to do everything in a similar manner to how I did it with P3: login := Login new database: MySQLPlatform new; username: 'root'; password: '****'; host: '<my host>'; port: '3306'; databaseName: 'test'. accessor := DatabaseAccessor forLogin: login. accessor login. accessor isLoggedIn. >>> true Yay, very nice. Then: session := GlorpBookDescriptorSystem sessionForLogin: login. *GlorpBookDescriptorSystem is subclass of DescriptorSystem. It comes from the demo from pharobooks with an example on how to use GLORP with P3. It contains the demo class models, descriptors and table definitions. And finally: session login. >>> Instance of MySQLDriver did not understand #queryEncoding :( Any hints appreciated.

Hi - I can’t help with your GLORP query but you may find ReStore a viable alternative, particularly if you're starting with a new database: https://github.com/rko281/ReStoreForPharo <https://github.com/rko281/ReStoreForPharo> I’ve just checked and the MySQL/MariaDB connector is working in both Pharo 9 and 10. Cheers. John Aspinall > On 22 Dec 2021, at 20:33, laszlo.szolnoki@gmail.com wrote: > > Hi, I’m new to the Pharo users mailing list and to Pharo in general, too. > > My goal is to make a CRUD web application using Seaside, Magritte, GLORP and MariaDB (MySQL-like RDBMS). > > I already test-drove GLORP with PostgreSQL-P3, with success. > > But I need MariaDB because it implements SQL:2011 (which Postgres lacks currently) thus enabling the use of system-versioned and bi-temporal tables. > > Currently I don’t need GLORP to handle any of the SQL:2011 features as the versioning would be invisible to the web app, it is needed only for auditing purposes. > > I tried to make the system work be installing the MySQL driver into a fresh Pharo9 image: > > Metacello new repository: 'github://pharo-rdbms/Pharo-MySQL'; baseline: 'MySQL'; load Since the package 'MySQL-Glorp' didn't load, I installed it manually from github. (Sorry but I'm noob to work with baselines, Iceberg, Monticello and such.) Then loaded GLORP: Metacello new repository: 'github://pharo-rdbms/glorp'; baseline: 'Glorp'; load. Then I tried to do everything in a similar manner to how I did it with P3: login := Login new database: MySQLPlatform new; username: 'root'; password: '****'; host: '<my host>'; port: '3306'; databaseName: 'test'. accessor := DatabaseAccessor forLogin: login. accessor login. accessor isLoggedIn. >>> true Yay, very nice. Then: session := GlorpBookDescriptorSystem sessionForLogin: login. *GlorpBookDescriptorSystem is subclass of DescriptorSystem. It comes from the demo from pharobooks with an example on how to use GLORP with P3. It contains the demo class models, descriptors and table definitions. And finally: session login. >>> Instance of MySQLDriver did not understand #queryEncoding :( Any hints appreciated. > >
TB
Todd Blanchard
Thu, Dec 23, 2021 7:01 PM

Load the glorp target from the MySQL repository.

On Dec 22, 2021, at 1:33 PM, laszlo.szolnoki@gmail.com wrote:

Hi, I’m new to the Pharo users mailing list and to Pharo in general, too.

My goal is to make a CRUD web application using Seaside, Magritte, GLORP and MariaDB (MySQL-like RDBMS).

I already test-drove GLORP with PostgreSQL-P3, with success.

But I need MariaDB because it implements SQL:2011 (which Postgres lacks currently) thus enabling the use of system-versioned and bi-temporal tables.

Currently I don’t need GLORP to handle any of the SQL:2011 features as the versioning would be invisible to the web app, it is needed only for auditing purposes.

I tried to make the system work be installing the MySQL driver into a fresh Pharo9 image:

Metacello new repository: 'github://pharo-rdbms/Pharo-MySQL'; baseline: 'MySQL'; load Since the package 'MySQL-Glorp' didn't load, I installed it manually from github. (Sorry but I'm noob to work with baselines, Iceberg, Monticello and such.) Then loaded GLORP: Metacello new repository: 'github://pharo-rdbms/glorp'; baseline: 'Glorp'; load. Then I tried to do everything in a similar manner to how I did it with P3: login := Login new database: MySQLPlatform new; username: 'root'; password: '****'; host: '<my host>'; port: '3306'; databaseName: 'test'. accessor := DatabaseAccessor forLogin: login. accessor login. accessor isLoggedIn. >>> true Yay, very nice. Then: session := GlorpBookDescriptorSystem sessionForLogin: login. *GlorpBookDescriptorSystem is subclass of DescriptorSystem. It comes from the demo from pharobooks with an example on how to use GLORP with P3. It contains the demo class models, descriptors and table definitions. And finally: session login. >>> Instance of MySQLDriver did not understand #queryEncoding :(  Any hints appreciated.

Load the glorp target from the MySQL repository. > On Dec 22, 2021, at 1:33 PM, laszlo.szolnoki@gmail.com wrote: > > Hi, I’m new to the Pharo users mailing list and to Pharo in general, too. > > My goal is to make a CRUD web application using Seaside, Magritte, GLORP and MariaDB (MySQL-like RDBMS). > > I already test-drove GLORP with PostgreSQL-P3, with success. > > But I need MariaDB because it implements SQL:2011 (which Postgres lacks currently) thus enabling the use of system-versioned and bi-temporal tables. > > Currently I don’t need GLORP to handle any of the SQL:2011 features as the versioning would be invisible to the web app, it is needed only for auditing purposes. > > I tried to make the system work be installing the MySQL driver into a fresh Pharo9 image: > > Metacello new repository: 'github://pharo-rdbms/Pharo-MySQL'; baseline: 'MySQL'; load Since the package 'MySQL-Glorp' didn't load, I installed it manually from github. (Sorry but I'm noob to work with baselines, Iceberg, Monticello and such.) Then loaded GLORP: Metacello new repository: 'github://pharo-rdbms/glorp'; baseline: 'Glorp'; load. Then I tried to do everything in a similar manner to how I did it with P3: login := Login new database: MySQLPlatform new; username: 'root'; password: '****'; host: '<my host>'; port: '3306'; databaseName: 'test'. accessor := DatabaseAccessor forLogin: login. accessor login. accessor isLoggedIn. >>> true Yay, very nice. Then: session := GlorpBookDescriptorSystem sessionForLogin: login. *GlorpBookDescriptorSystem is subclass of DescriptorSystem. It comes from the demo from pharobooks with an example on how to use GLORP with P3. It contains the demo class models, descriptors and table definitions. And finally: session login. >>> Instance of MySQLDriver did not understand #queryEncoding :( Any hints appreciated. > >
LS
laszlo.szolnoki@gmail.com
Fri, Dec 24, 2021 12:44 AM

I’m halfway through the documentation and made some tests.

I am very impressed by ReStore so far, to say the least.

Feels like a Christmas present :)

Thank you, Sir.

Laszlo

I’m halfway through the documentation and made some tests. I am very impressed by ReStore so far, to say the least. Feels like a Christmas present :) Thank you, Sir. Laszlo