Forums

Find answers, ask questions, and connect with our
community all around the world.

Home Forum Omnis General Forum Easy way to send library WITH database?

  • Easy way to send library WITH database?

    Posted by Uwe Smidt on February 5, 2023 at 11:18 am

    Dear $all,

    is there an easy way to send someone else your application (i.e. library, database structure & data) as a complete package, ideally self-contained & ready to run?

    This question arises to me when asking for support at Omnis, and sometimes they ask me to send either a prototype app of the isolated problem, or the whole library. But without the database (in my case Postgres) some problems may not be reproduced without a running database. However, setting up my database is asking too much – so is there a way to ‘pre-package’ that maybe in SQLite or to containerize it?

    Thanks for any ideas!

    Best regards

    Uwe

    Andreas Pfeiffer replied 1 month, 2 weeks ago 2 Members · 3 Replies
  • 3 Replies
  • Andreas Pfeiffer

    Administrator
    February 6, 2023 at 9:41 am

    Hello Uwe,

    It is possible to store any binary information in the $userinfo of a class i.e.

    Say you want to show a problem that occurs in a certain remote form with a data grid and you need to have your data in a list to show this. You can do the following:

    1. Copy the remote form into a new library. You can do this using drag&drop.

    2. Put a breakpoint in your original library after the data have been loaded into the list variable.

    3. When the code stops at the breakpoint and the list is loaded add a line of code to copy the list into the $userinfo of the class that is in the other library:

    Do $libs.newLibrary.$classes.myRemoteForm.$userinfo.$assign(iDataList)

    Save class newLibrary.myRemoteForm

    Note that we do not want to store the list data into the class of the current library. The command “save class” ensures that the change is written back to the hard drive. Alternatively you could have left the class open in design mode and hit the “save” button to save the class.

    4. Finally comment out the code that loads the list in the remote form that is now in the new library and add a new line to it so that it copies the data from the $userinfo property of the class back into the list:

    Calculate iDataList as $cinst.$class().$userinfo

    You might need to add an empty remote task to make the remote form working in the new library. Also make sure to remove the line of code in your original library that copies the data over to the $userinfo property in the class of the other library.

    5. Test if the remote form runs now from within the new library and if you are able to reproduce the original problem there.

    I hope this helps!

    Best regards,

    Andreas

  • Uwe Smidt

    Member
    February 7, 2023 at 4:31 pm

    Dear Andreas,

    Thank you for your prompt and comprehensive answer!

    I assume your solution works fine for an isolated problem in one form.

    But if the problem is more complex or difficult to locate in an application/library, it may become more economic to include the whole database for the troubleshooting, as opposed to rebuilding parts of an application into a stand-alone prototype to reproduce the problem.

    Therefor I look for an approach to include the database structure & data along with the library.

    But I assume there is no such easy way with little effort on the sending and receiving side. Instead, probably doing a database dump and sending it along side, plus a dialog to edit connection parameters, is the better way…

    Thank you anyway

    Best regards

    Uwe

    • This reply was modified 1 month, 2 weeks ago by  Uwe Smidt.
  • Andreas Pfeiffer

    Administrator
    February 9, 2023 at 8:03 am

    Hi Uwe,

    There is probably no easy way. And even then somebody would need to extract the problem.

    So in some cases it is worth trying to break the part out where the problem is. In some cases that leads to find out what is going wrong if it is a logical error for example. And if the problem still exists then it is easier to present this to the Omnis support team.

    Best regards,

    Andreas

Log in to reply.