Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-42970

Introduce N1QL function that generates an error

    XMLWordPrintable

Details

    • 1

    Description

      Consider this function:

      CREATE FUNCTION variadic(...) { CASE WHEN array_length(args) != 1 THEN "wrong args: " || to_string(array_length(args))  WHEN type(args[0]) = "string" THEN args[0] ELSE "wrong type " || type(args[0]) || ": " || to_string(args[0]) END }
      

      Wouldn't it be nice to be able to return errors on wrong arguments?
      Introduce a new predefined function abort(string) which returns nothing and generates an error based on the input string, so that N1QL UDFs (or other statements) can properly generate an error and terminate the request

      Attachments

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

        Activity

          People

            ajay.bhullar Ajay Bhullar
            marco.greco Marco Greco (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty