No announcement yet.

Pleae add a new macro for create, alter or delete Connections in production environme

  • Filter
  • Time
  • Show
Clear All
new posts

  • Pleae add a new macro for create, alter or delete Connections in production environme

    Hi Friends,

    Please create a new macro for test, create, alter or delete connections in production environment using code.

    by example,
    1) I test if the desired connection exist (with a new macro sc_connection_exist("conn_name", boolean)
    2) if don't exist, I create one new connection (with a new macro sc_connection_create("conn_name", "Mysql", "server", "root", "root", "database_name")

    3) then I'am free to change connections into my normal sc aplication using the actual macro sc_change_connection()

    Last edited by aquiles; 09-21-2013, 11:26 AM.

  • #2

    I have just sent your suggestion to our team.

    Bernhard Bernsmann


    • #3
      Can you use the production manager screen to do this". Why would you need to do this, the applications can't be recompiled in the production environment and you can't change the connections on the deployed application, maybe I don't understand how one could use this feature which by the way, the production "manager" screen allows you to create, modify or rename a connection, not sure about deleting one, see below.



      • #4
        Hi Javier,

        The idea is to do all the production process using only php code.

        sure, if I have only one database then this feature isn't neccesary, but the idea is when I have ONE application binded to MANY similar databases (a SASS service) then when one new company is registered, then the application find if the database and the connection to this database/company exist, if not then proceed to create the database and the connection WITHOUT HUMAN intervention.



        • #5
          Ok but once you create the new database and new connection how do you change the connection inside the applications already in the production environment?


          • #6
            Hi Bernhard Bernsmann,

            I would like to support the request by Aquile
            "Pleae add a new macro for create, alter or delete Connections in production environment"
            on the following ground.

            For example, an accounting firm has a few hundred clients. Each client has their own database to store their accounting record. We can not fix number of connection needed as clients are increase over the time i.e. new database are created as well.
            (Note: over here all the clients’ database has the same table structure.)

            In the current production environment, it does not allow create new connection after the project publishes to the web. Therefore new connections for new clients are not possible unless we need return to production environment and create them manually.

            Due to this limitation, it is not feasible and impractical to create a few hundreds connection in this scenario perhaps it should have a function to create a generic connection for unlimited database.

            In view of this, I hope you can urge your team to incorporate this new feature as soon as possible i.e. able to create new connection / edit existing connection on the fly programmatically.

            I am looking forward for your good news.


            • #7
              Hello Drcolew,

              Thanks for your feedback. I will let our team know.



              • #8
                Hi everyone,

                A common practice in my country is to have different databases for different fiscal years. So at end of period, a user would run a procedure that creates a blank database, initialize data and then create a new conecction using the new initialized database, all this programatically.

                Another case would be project management, where each project has it's own database and a single app should permit the user to manage different projects.

                I think Scriptcase should be able to support such scenarios easily.

                Scriptcase is a rapidly evolving tool and so far I like where it's heading, please keep up the good work!

                Best regards,

                Alejandro Contreras
                Guadalajara, Mexico


                • #9
                  Hi Friends,

                  thanks for supporting the idea,

                  another solution could be that the connection scope was only for the server engine, (not the database)
                  and every scriptcase app have an aditional property with the database name by default, this property [gl_DatabaseName] can be changed at runtime

                  THEN every SQL sentence generated by Sc or writted by the developer need be modified with the database.table sintax

                  select ......... from db2014.customers .....

                  in this case

                  select ......... from [gl_DatabaseName].customers ....

                  insert into [gl_Databasename].customers .....
                  update [gl_DatabaseName].customers ....
                  delete from [gl_DatabaseName].customers

                  please see the attached video


                  Last edited by aquiles; 01-09-2014, 11:14 PM.