Я хочу выполнить следующий запрос в «Activerecord».Как я могу это сделать?Пожалуйста, помогите мне ..
query = "SELECT rc.constraint_schema||'.'||tc.table_name AS table_name, kcu.column_name FROM information_schema.referential_constraints AS rc JOIN information_schema.table_constraints AS tc USING(constraint_catalog,constraint_schema,constraint_name) JOIN information_schema.key_column_usage AS kcu USING(constraint_catalog,constraint_schema,constraint_name) JOIN information_schema.key_column_usage AS ccu ON(ccu.constraint_catalog=rc.unique_constraint_catalog AND ccu.constraint_schema=rc.unique_constraint_schema AND ccu.constraint_name=rc.unique_constraint_name) WHERE ccu.table_catalog=\"#{connection_parameters['database']}\" AND ccu.table_schema=\"#{connection_parameters['schema_search_path']}\" AND ccu.table_name=\"#{tab}\" AND ccu.column_name=\"#{select}\""