Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-15499

Add an eZDB*::tableExists() method

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Obsolete
    • Icon: Medium Medium
    • Future
    • 4.0.6, 4.1.3, 4.2.0alpha1, 4.2.0beta1, extension/ezoracle 1.8.1, extension/ezoracle 1.8.2, extension/ezoracle 2.0.1
    • Database related
    • None

    Description

      While fixing issue #15377 (mbpaex), I decided to check if the required table exists, and not register the datatype if it doesn't.

      The issue is that there is currently no clean (e.g. without throwing an error), cross-database way to check if a table exists.

      On MySQL, it can be done using:
      SHOW TABLES LIKE '<tablename>'
      And check if 0 or 1 results were returned.

      This thread gives hints on how to do it on oracle:
      http://forums.devshed.com/oracle-development-96/show-tables-in-oracle-135613.html

      The method for PostgreSQL yet has to be found, but it can't be very complex.

      Proposal:

      /**
       * Checks if a table exists in the database
       * @param string $tableName Name of the table to check existence of
       * @return bool true if the table exists, false if it doesn't
       **/
      function tableExists( $tableName );
      

      Attachments

        Activity

          People

            unknown unknown
            bd bd
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: