Uploaded image for project: 'Couchbase PHP client library'
  1. Couchbase PHP client library
  2. PCBC-398

Need documented way to specify N1QL query parameters

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.0
    • Component/s: None
    • Labels:
      None

      Description

      There's no documented way to specify N1QL query parameters. I can hack something by using the 'options' array, but that's difficult to find. We should be encouraging users to use parameterized queries, not discouraging them.

      Currently I'm using

          $query = CouchbaseN1qlQuery::fromString('SELECT airportname FROM `travel-sample` WHERE city=$1 AND type="airport"');
          $query->options['args'] = array($city);
      

      But I suppose you could do something, either in the constructor, or as namedParams(), posParams(), etc.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              avsej Sergey Avseyev
              Reporter:
              mnunberg Mark Nunberg (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes

                  PagerDuty

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.