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

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.2.0
    • None
    • 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

            avsej Sergey Avseyev
            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