Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-16695

drush civicrm-sql-query does not accept piped query

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.6.3
    • Fix Version/s: 4.7
    • Labels:
      None
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code

      Description

      drush help civicrm-sql-query tells me:

      Usage: drush [options] civicrm-sql-query <query>...
      <query> is a SQL statement, which can alternatively be passed via STDIN. Any additional arguments are passed to the mysql command directly.

      Examples:
      drush civicrm-sql-query "SELECT * FROM Browse user record
      civicrm_contact WHERE id=1"

      Arguments:
      query A SQL query. Mandatory.

      The optional "which can alternatively be passed via STDIN" suggests that I can pipe the query to this command.

      So I tried to work around the absence of 'drush civicrm-sql-sync' by running:

      drush @dev civicrm-sql-dump | drush @prod civicrm-sql-query

      Which fails with:

      Missing argument 1 for drush_civicrm_sqlquery() civicrm.drush.inc:1305

        Attachments

          Activity

            People

            • Assignee:
              palantejon Jon K Goldberg
              Reporter:
              ñull René Nieuwburg
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: