Пример #1
0
 def backend_supported(self, manager, **kwargs):
     return (
         (
             (
                 kwargs['is_catalog'] and
                 (
                     (
                         self.CATALOG_DB_SUPPORTED and
                         kwargs['db_support']
                     ) or (
                         not self.CATALOG_DB_SUPPORTED and
                         not kwargs[
                             'db_support'] and
                         (
                             self.SUPPORTED_SCHEMAS is None or
                             kwargs[
                                 'schema_name'] in self.SUPPORTED_SCHEMAS
                         )
                     )
                 )
             ) or
             (
                 not kwargs['is_catalog'] and self.CATALOG_DB_SUPPORTED
             )
         ) and
         CollectionNodeModule.backend_supported(self, manager, **kwargs)
     )
Пример #2
0
def backend_supported(module, manager, **kwargs):
    if 'tid' in kwargs and CollectionNodeModule.BackendSupported(
            module, manager, **kwargs):
        conn = manager.connection(did=kwargs['did'])

        template_path = 'partition/sql/{0}/#{0}#{1}#'.format(
            manager.server_type, manager.version)
        SQL = render_template("/".join([template_path, 'backend_support.sql']),
                              tid=kwargs['tid'])
        status, res = conn.execute_scalar(SQL)

        # check if any errors
        if not status:
            return internal_server_error(errormsg=res)

        return res
Пример #3
0
    def BackendSupported(self, manager, **kwargs):
        """
        Load this module if it is a partition table
        """
        if manager.server_type == 'gpdb':
            return False
        if 'tid' in kwargs and CollectionNodeModule.BackendSupported(self, manager, **kwargs):
            conn = manager.connection(did=kwargs['did'])

            template_path = 'partition/sql/#{0}#'.format(manager.version)
            SQL = render_template("/".join(
                [template_path, 'backend_support.sql']), tid=kwargs['tid'])
            status, res = conn.execute_scalar(SQL)

            # check if any errors
            if not status:
                return internal_server_error(errormsg=res)

            return res