# # Created on Thu Aug 27 2020 # # This file is a part of Skytable # Skytable (formerly known as TerrabaseDB or Skybase) is a free and open-source # NoSQL database written by Sayan Nandan ("the Author") with the # vision to provide flexibility in data modelling without compromising # on performance, queryability or scalability. # # Copyright (c) 2020, Sayan Nandan # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # # # # This file is used by Skytable's documentation website for automatically # generating documentation for the actions. It will also be used by the Skytable # server in the future # the docbuilder expects: # 'name': str, 'complexity': str, 'accept': [str] # 'return': [str], 'syntax': [str], 'desc': str global: - name: HEYA complexity: O(1) accept: [AnyArray] syntax: [HEYA, HEYA ] desc: | Either returns a "HEY!" or returns the provided argument as an `str` return: [String] - name: DBSIZE complexity: O(1) accept: [AnyArray] syntax: [DBSIZE, DBSIZE ] desc: Check the number of entries stored in the current table or in the provided entity return: [Integer] - name: MKSNAP complexity: O(n) accept: [AnyArray] syntax: [MKSNAP, MKSNAP ] desc: | This action can be used to create a snapshot. Do note that this action **requires snapshotting to be enabled on the server side**, before it can create snapshots. If you want to create snapshots **without** snapshots being enabled on the server-side, pass a second argument `` to specify a snapshot name and a snapshot will be create in a folder called `rsnap` under your data directory. For more information on snapshots, read [this document](/snapshots) return: [Rcode 0, err-snapshot-disabled, err-snapshot-busy] - name: FLUSHDB complexity: O(n) accept: [AnyArray] syntax: [FLUSHDB, FLUSHDB ] desc: Removes all entries stored in the current table or in the provided entity return: [Rcode 0, Rcode 5] keyvalue: generic: - name: DEL complexity: O(n) accept: [AnyArray] syntax: [DEL ...] desc: | Delete 'n' keys from the current table. This will return the number of keys that were deleted as an unsigned integer return: [Integer, Rcode 5] - name: EXISTS complexity: O(n) accept: [AnyArray] syntax: [EXISTS ...] desc: | Check if 'n' keys exist in the current table. This will return the number of keys that exist as an unsigned integer. return: [Integer] - name: LSKEYS complexity: O(n) accept: [AnyArray] syntax: [LSKEYS , LSKEYS , LSKEYS ] desc: | Returns a flat string array of keys present in the current table or in the provided entity. If no `` is given, then a maximum of 10 keys are returned. If a limit is specified, then a maximum of `` keys are returned. The order of keys is meaningless. return: [Typed Array] string: - name: GET complexity: O(1) accept: [AnyArray] syntax: [GET ] desc: Get the value of a key from the current table, if it exists return: [Rcode 1, String, Binstr] - name: MGET complexity: O(n) accept: [AnyArray] syntax: [MGET ...] desc: Get the value of 'n' keys from the current table, if they exist return: [Typed Array] - name: SET complexity: O(1) accept: [AnyArray] syntax: [SET ] desc: Set the value of a key in the current table, if it doesn't already exist return: [Rcode 0, Rcode 2, Rcode 5] - name: MSET complexity: O(n) accept: [AnyArray] syntax: [MSET ...] desc: | Set the value of 'n' keys in the current table, if they don't already exist. This will return the number of keys that were set as an unsigned integer. return: [Integer, Rcode 5] - name: UPDATE complexity: O(1) accept: [AnyArray] syntax: [UPDATE ] desc: Update the value of an existing key in the current table return: [Rcode 0, Rcode 1, Rcode 5] - name: MUPDATE complexity: O(n) accept: [AnyArray] syntax: [MUPDATE ...] desc: | Update the value of 'n' keys in the current table, if they already exist. This will return the number of keys that were updated as an unsigned integer. return: [Integer, Rcode 5] - name: SSET complexity: O(n) accept: [AnyArray] syntax: [SSET ...] desc: Set all keys to the given values only if all of them don't exist in the current table return: [Rcode 0, Rcode 2, Rcode 5] - name: SDEL complexity: O(n) accept: [AnyArray] syntax: [SDEL ...] desc: | Delete all keys if all of the keys exist in the current table. Do note that if a single key doesn't exist, then a `Nil` code is returned. return: [Rcode 0, Rcode 1, Rcode 5] - name: SUPDATE complexity: O(n) accept: [AnyArray] syntax: [SUPDATE ...] desc: | Update all keys if all of the keys exist in the current table. Do note that if a single key doesn't exist, then a `Nil` code is returned. return: [Rcode 0, Rcode 1, Rcode 5] - name: USET complexity: O(n) accept: [AnyArray] syntax: [USET ...] desc: SET all keys if they don't exist, or UPDATE them if they do exist. This operation performs `USET`s in the current table return: [Integer, Rcode 5] - name: KEYLEN complexity: O(1) accept: [AnyArray] syntax: [KEYLEN ] desc: Returns the length of the UTF-8 string, if it exists in the current table return: [Integer, Rcode 1] - name: POP complexity: O(1) accept: [AnyArray] syntax: [POP ] desc: | Deletes and return the value of the provided key from the current table. If the database is poisoned, this will return a server error. return: [String, Binstr, Rcode 5] - name: MPOP complexity: O(n) accept: [AnyArray] syntax: [MPOP ...] desc: | Deletes and returns the values of the provided 'n' keys from the current table. If the database is poisoned, this will return a server error return: [Typed Array, Rcode 5] lists: - name: LGET desc: | `LGET` can be used to access the items in a list. Through the sub-actions provided by `lget`, you can access multiple or individual elements in lists. subactions: - name: LGET complexity: O(n) accept: [AnyArray] syntax: [LGET ] desc: | Returns all the values contained in a the provided list, if it exists in the current table. return: [Typed Array, Rcode 1] - name: limit complexity: O(n) accept: [AnyArray] syntax: [LGET limit ] desc: Returns a maximum of `limit` values from the provided list, if it exists in the current table return: [Typed Array, Rcode 1] - name: len complexity: O(1) accept: [AnyArray] syntax: [LGET len] desc: Returns the length of the list return: [Integer, Rcode 1] - name: valueat complexity: O(1) accept: [AnyArray] syntax: [LGET valueat ] desc: Returns the element present at the provided `index`, if it exists in the given list. return: [String, binstr, Rcode 1, list-bad-index] - name: first complexity: O(1) accept: [AnyArray] syntax: [LGET first] desc: Returns the first element present in the list, if it exists. return: [String, binstr, Rcode 1, list-is-empty] - name: last complexity: O(1) accept: [AnyArray] syntax: [LGET last] desc: Returns the last element present in the list, if it exists. return: [String, binstr, Rcode 1, list-is-empty] - name: LMOD desc: | `LMOD` can be used to mutate the elements in a list subactions: - name: push complexity: O(1) accept: [AnyArray] syntax: [LMOD push ] desc: Appends the element to the end of the provided list return: [Rcode 0, Rcode 1, Rcode 5] - name: insert complexity: O(1) accept: [AnyArray] syntax: [LMOD insert ] desc: | Inserts the element to the provided index, if it is valid while shifting elements to the right if required return: [Rcode 0, Rcode 1, Rcode 5, bad-list-index] - name: pop complexity: O(1) accept: [AnyArray] syntax: [LMOD pop, LMOD pop ] desc: | Removes the element from the end of the list if no index is provided or from the provided index while shifting elements to the right if required. return: [String, Binstr, Rcode 0, Rcode 1, Rcode 5, bad-list-index] - name: remove complexity: O(1) accept: [AnyArray] syntax: [LMOD remove ] desc: | Removes the element at the provided index from the list, shifting elements to the right if required. return: [Rcode 0, Rcode 1, Rcode 5, bad-list-index] - name: clear complexity: O(n) accept: [AnyArray] syntax: [LMOD clear] desc: | Removes all the elements present in the list return: [Rcode 0, Rcode 1, Rcode 5] - name: LSET desc: | `LSET` can be used to create empty lists or lists with the provided values. subactions: - name: LSET complexity: O(n) accept: [AnyArray] syntax: [LSET , LSET ...] desc: | Creates a list with the provided values, or simply creates an empty list if it doesn't already exist in the table. return: [Rcode 0, Rcode 1, Rcode 5]