• ReStore and MySQL

    From Mark Davis@21:1/5 to All on Tue Aug 11 12:40:56 2020
    I've been using ReStore with MS Access for years. Current project requires MySQL. Unfortunately, the ReStore docs only cover generating tables in Access. Are there any examples or a quick tutorial that shows how to generate tables from dolphin smalltalk
    using MySQL database?

    Thanks,

    Mark

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Aspinall@21:1/5 to Mark Davis on Wed Aug 12 00:21:34 2020
    Hi Mark,

    There shouldn't be any differences in generating tables in MySQL versus Access - ReStore should take care of any dialect differences.

    The current ReStore documentation is linked from the github repository (see end of readme section):

    https://github.com/rko281/ReStore

    Let me know if you need any further info.

    Cheers.

    John


    On Tuesday, August 11, 2020 at 8:40:57 PM UTC+1, Mark Davis wrote:
    I've been using ReStore with MS Access for years. Current project requires MySQL. Unfortunately, the ReStore docs only cover generating tables in Access. Are there any examples or a quick tutorial that shows how to generate tables from dolphin
    smalltalk using MySQL database?

    Thanks,

    Mark

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mark Davis@21:1/5 to All on Wed Aug 12 02:05:04 2020
    Hi John,

    I should have been more specific; the server is installed on a remote server. So, I have to provide an ip address in the script to get a connection? All smalltalk clients will access the server via ip address when deployed. So can only guess the ip
    address must be provided:

    aRestore := SSWReStore new.
    aRestore dsn: 'dbname=test_database;hostname=192.168.1.150'.
    aRestore uid: 'root'.
    aRestore pwd: '123456'.
    aRestore useTransactionsWithoutVersioning.
    aRestore supportsFullTableRecords: true.
    aRestore connect.

    afterwhich, the script adds the appropriate classes:

    aRestore
    addClass: ClassA;
    addClass: ClassB;
    addClass: ClassC.
    aRestore synchronizeAllClasses.

    aRestore disconnect.
    aRestore := nil.

    I'll give this a whirl in the morning and see how it goes.
    Hopefully this is the correct procedure to connect to the remote server opposed to connecting to a database on the same dev machine.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Aspinall@21:1/5 to Mark Davis on Thu Aug 13 00:55:42 2020
    Hi Mark,

    Specifying a connection via the dsn: message needs a defined data source name from the 32-bit ODBC control panel. I usually configure this as part of a deployed application's setup script.

    Specifying a connection directly from application code needs the connectString: message using the parameter names for the particular database type you're using. Those for MySQL are detailed here:

    https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-configuration-connection-without-dsn.html

    For your example this would give (depending on the version of the MySQL ODBC connector you're using):

    aReStore connectString: 'DRIVER={MySQL ODBC 8.0 ANSI Driver};SERVER=192.168.1.150;DATABASE=test_database;USER=root;PASSWORD=123456'.

    Using a connection string in this way is supported in recent versions of ReStore. If you're using an older version let me know and I can supply a patch file to enable this.

    Hope this helps.

    John



    On Wednesday, August 12, 2020 at 10:05:05 AM UTC+1, Mark Davis wrote:
    Hi John,

    I should have been more specific; the server is installed on a remote server. So, I have to provide an ip address in the script to get a connection? All smalltalk clients will access the server via ip address when deployed. So can only guess the ip
    address must be provided:

    aRestore := SSWReStore new.
    aRestore dsn: 'dbname=test_database;hostname=192.168.1.150'.
    aRestore uid: 'root'.
    aRestore pwd: '123456'.
    aRestore useTransactionsWithoutVersioning.
    aRestore supportsFullTableRecords: true.
    aRestore connect.

    afterwhich, the script adds the appropriate classes:

    aRestore
    addClass: ClassA;
    addClass: ClassB;
    addClass: ClassC.
    aRestore synchronizeAllClasses.

    aRestore disconnect.
    aRestore := nil.

    I'll give this a whirl in the morning and see how it goes.
    Hopefully this is the correct procedure to connect to the remote server opposed to connecting to a database on the same dev machine.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mark Davis@21:1/5 to All on Thu Aug 13 23:50:04 2020
    John,

    As you described, the process is pretty much the same when it comes to ReStore and MySQL. I downloaded the 32 ODBC driver and was able to populate the mysql database with all 62 classes from Dolphin. Transactions are working fine as well; no problems
    whatsoever.

    Just downloaded Dolphin 7 and I look forward to using it with the new version of ReStore in the near future. I had a few (unfounded) concerns as I had always used ReStore with MS Access. ReStore comes through like a champ for MySQL. Awesome framework;
    glad to have it available for Dolphin.

    Thanks for the assistance John, most appreciated.

    Best Regards,

    Mark

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)