Details

    Description

      Most SQL engines have a feature called sequences or serials - an atomic counter which is incremented every time it is accessed.
      This is used widely for the generation of keys.

      Our KV supports a special time of counter documents which can be incremented atomically.
      In order to facilitate migration of relational applications to N1QL we should take advantage of the KV counters and create a similar facility as sequences - with DDL and suitable functions to increment and query the sequence values.

      As a possible suggestion, somewhat mimicking Oracle:

      CREATE SEQUENCE sequenceName IN keyspace WITH (<sequence specs>)
      ALTER SEQUENCE keyspace.sequenceName TO (<sequence specs>)
      DROP SEQUENCE keyspace.sequenceName
      nextval(keyspace.sequenceName)  -> Now SQL standard: NEXT VALUE FOR ...
      currval(keyspace.sequenceName) -> Now: PREV VALUE FOR ...

      Attachments

        Issue Links

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

          Activity

            People

              pierre.regazzoni Pierre Regazzoni
              marco.greco Marco Greco (Inactive)
              Votes:
              6 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty