Update docs and fix dpkg scripts [skip ci]
parent
bbcb7acb95
commit
8c4009f2b8
@ -1,34 +0,0 @@
|
||||
name: Rebuild docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- next
|
||||
env:
|
||||
IS_ACTIONS_DOC: "false"
|
||||
|
||||
jobs:
|
||||
rebuild-docs:
|
||||
name: Build new actiondoc
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Setup environment
|
||||
run: |
|
||||
chmod +x ci/setvars.sh
|
||||
ci/setvars.sh
|
||||
|
||||
- name: Publish docs
|
||||
env:
|
||||
BOT_USER: ${{ secrets.BOT_INIT_USER }}
|
||||
BOT_MAIL: ${{ secrets.BOT_INIT_MAIL }}
|
||||
BOT_API: ${{ secrets.BOT_API_CALL }}
|
||||
GIT_SHA: ${{ env.GITHUB_SHA }}
|
||||
run: |
|
||||
chmod +x ci/doc.sh
|
||||
ci/doc.sh
|
||||
if: env.IS_ACTIONS_DOC == 'true'
|
@ -0,0 +1,18 @@
|
||||
----
|
||||
Notes for v0.8.0
|
||||
----
|
||||
|
||||
I'd like to thank a lot of the people that have very indirectly had some influence on Skytable's design. Here's a little list (in no
|
||||
particular order):
|
||||
|
||||
- First of all I'd like to thank Raymond F. Boyce and Donald D. Chamberlin for their work on SQL. While I'm not fortunate enough to have
|
||||
any connection to them, a lot of their work have laid out guiding principles for my work.
|
||||
- I'd also like to thank several people from the Rust community (listed in no particular order):
|
||||
- Aaron Turon: Aaron's work on concurrency libraries have greatly helped in parts of "design thinking"
|
||||
- Carl Lerche (@carllerche): For the immense amount of work Carl done on Tokio and related systems.
|
||||
- Michael Vaner (@vorner): For their work on designing concurrency primitives. I'm a great admirer of Michael's work but
|
||||
unfortunately haven't had the opportunity to directly talk.
|
||||
- Amanieu d'Antras (@Amanieu): Amanieu's work on parking_lot and hashbrown have been eye openers for several things that I've designed
|
||||
and implemented, both in and out of Skytable
|
||||
|
||||
-- Sayan N. (Dec, 2023 <ohsayan@outlook.com>)
|
@ -1,82 +1,125 @@
|
||||
<html>
|
||||
<div align="center">
|
||||
<img src="assets/logo.jpg" height=64 width=64>
|
||||
<h1>Skytable</h1><h3>Your next NoSQL database</h3>
|
||||
<br/><p align="center">
|
||||
<img width="150" src="assets/logo.jpg">
|
||||
</p>
|
||||
<h2 align = "center">
|
||||
Skytable — A modern database for building powerful experiences
|
||||
</h2>
|
||||
<h3 align="center">
|
||||
Performance, scalability and flexibility. Choose three.
|
||||
</h3>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://github.com/skytable/skytable/releases"><img src="https://img.shields.io/github/v/release/skytable/skytable?style=flat" alt="GitHub release (with filter)"></a> <a href="https://github.com/skytable/skytable/actions"><img src="https://img.shields.io/github/actions/workflow/status/skytable/skytable/test-push.yml?style=flat" alt="GitHub Workflow Status (with event)"></a> <a href="https://discord.gg/QptWFdx"><img src="https://img.shields.io/discord/729378001023926282?logo=discord&style=flat" alt="Discord"></a> <a href="https://docs.skytable.io"><img src="https://img.shields.io/badge/read%20the%20docs-here-blue?style=flat" alt="Docs"></a> <a href="https://github.com/skytable/skytable/discussions?style=flat"><img src="https://img.shields.io/badge/discuss-here-8A3324?style=flat&logo=github&labelColor=C34723" alt="Static Badge"></a>
|
||||
</p>
|
||||
|
||||
![GitHub Workflow Status](<https://img.shields.io/github/workflow/status/skybasedb/skybase/Test%20(push)>) ![Development](https://img.shields.io/badge/development-regular-32CD32?style=flat-square) ![GitHub release (latest SemVer including pre-releases)](https://img.shields.io/github/v/release/skybasedb/skybase?include_prereleases&sort=semver&style=flat-square)
|
||||
[![Docs](https://img.shields.io/badge/readthedocs-here-blueviolet?style=flat-square)](https://docs.skytable.io) [![Contribute Now](https://img.shields.io/badge/%F0%9F%8C%9Fcontribute-now-a94064)](https://ohsayan.github.io/skythanks) [![Discord](https://img.shields.io/badge/talk-on%20discord-7289DA?logo=discord&style=flat-square")](https://discord.gg/QptWFdx)
|
||||
## 💡 What is Skytable?
|
||||
|
||||
</div>
|
||||
</html>
|
||||
Skytable is a **modern NoSQL database** that focuses on **performance, flexibility and scalability**. Our goal is to deliver **a rock-solid database** that you can use as the foundation for your next application — **minus the gimmicks**.
|
||||
|
||||
## What is Skytable?
|
||||
Skytable makes every attempt to **remove the gotchas from SQL-systems**. For example, nonempty `model`s and `space`s cannot be dropped and **BlueQL is designed to greatly deter SQL injection vulnerabilities** with a new **mandatory parameterization** design and several other **secure query language design principles**.
|
||||
|
||||
Skytable is a free and open-source NoSQL database that aims to provide flexible data modeling at
|
||||
scale. For us simplicity, performance and flexibility are our guiding design principles.
|
||||
We were previously known as TerrabaseDB or Skybase and are nicknamed Sky, SDB or STable by the community.
|
||||
Every component in Skytable has been **engineered from the ground up** to meet our design goals. **Skytable uses BlueQL<sup>TM</sup>** which is our own **new in-house query language** designed from the ground up for a **clean, powerful, modern and secure querying experience** and is **generally more secure than SQL**.
|
||||
|
||||
Features like keyspaces, tables, data types, authn+authz, snapshots and more are ready for you to use while we're working on [several new data models and features](https://github.com/skytable/skytable/issues/203). Skytable's key/value store is performant, secure and ready for you to deploy.
|
||||
Skytable works with **structured and semi-structured data**. We're currently working on supporting unstructured data.
|
||||
|
||||
## Getting started 🚀
|
||||
> **You can read more about Skytable's architecture, including information on the clustering and HA implementation that we're currently working on, and limitations [on this page](https://docs.skytable.io/architecture).**
|
||||
|
||||
1. Download a bundle for your platform from [here ⬇️ ](https://github.com/skytable/skytable/releases)
|
||||
2. Unzip the bundle
|
||||
3. Make the files executable (run `chmod +x skyd skysh` on \*nix systems)
|
||||
4. First run `skyd` to start the database server and then run `skysh` to start the interactive shell
|
||||
5. Run commands like: `SET foo bar` , `GET bar` , `UPDATE cat mitten` or `DEL proprietary` on `skysh`!
|
||||
## 🎨 Features
|
||||
|
||||
You can learn more about installation [here](https://docs.skytable.io/getting-started)
|
||||
- **Spaces, models and more**: For flexible data definition
|
||||
- **Powerful querying with BlueQL**: A modern query language, designed for the 21<sup>st</sup> century
|
||||
- **Rich data modeling**: Use `model`s to define data with complex types, collections and more
|
||||
- **Performant, in and out of the box**: Heavily multithreaded and optimized
|
||||
- **Secure, query in and response out**: BlueQL is designed to strongly deter query injection pathways
|
||||
- **SQL minus the gotchas**: Ever done a `DROP TABLE users` and lost all data? **That won't happen in Skytable**.
|
||||
- **Designed to scale by enforcing best practices**: If you're building with Skytable today, the practices you'll learn here will let you easily take on the job of building large scale systems
|
||||
|
||||
## Features
|
||||
> Learn more about [Skytable's features here](https://docs.skytable.io).
|
||||
|
||||
- **Insanely fast**: Scale to millions of queries per second per node. See [benchmarks here](https://github.com/ohsayan/sky-benches).
|
||||
- **Multiple keyspaces/tables**: Seamlessly integrates with actions to provide a SQL-like experience
|
||||
- **Key/value store**: `GET` , `SET` , `UPDATE` and [all that stuff](https://docs.skytable.io/all-actions). With the `str` and `binstr` types.
|
||||
- **Authn/Authz**: Simple and secure authentication/authorization
|
||||
- **Volatile tables**: For all the caching you need
|
||||
- **Snapshots**: Automated (and tunable) snapshots for stress-free backups
|
||||
- **Secure**: Secure connections are built into Skytable with SSL/TLS
|
||||
- **Multithreaded**: Designed to exploit all CPU cores
|
||||
- **Resource friendly**: The database server doesn't need more than 1MB to run
|
||||
- **Convenient**: Without the setup hassle and system-specific dependencies
|
||||
## 🚀 Getting started
|
||||
|
||||
**🛣️ There's a lot more coming! View our [roadmap](https://github.com/skytable/skytable/issues/203)**
|
||||
1. **Set up Skytable on your machine**: You'll need to download a bundled release file [from the releases page](https://github.com/skytable/skytable/releases). Unzip the files and you're ready to go.
|
||||
2. Start the database server: `./skyd --auth-root-password <password>` with your choice of a password for the `root` account. The `root` account is just like a `root` account on Unix based systems that has control over everything.
|
||||
3. Start the interactive client REPL: `./skysh` and then enter your password.
|
||||
4. You're ready to run queries!
|
||||
|
||||
## Clients 🔌
|
||||
> **For a more detailed guide on installation and deployment, [follow the guide here.](https://docs.skytable.io/installation)**
|
||||
|
||||
The project currently maintains an official [Rust driver](https://github.com/skytable/client-rust) and we have plans
|
||||
to support more languages along the way!
|
||||
We also maintain a list of [community supported drivers here](https://github.com/skytable/skytable/wiki/Drivers).
|
||||
|
||||
If you want to use a different language, for now you'll just need to implement the simple and performant [Skyhash Protocol](https://docs.skytable.io/protocol/skyhash).
|
||||
## ⚡ Using Skytable
|
||||
|
||||
## Community 👐
|
||||
Skytable has `SPACE`s instead of `DATABASE`s due to signficant operational differences (and because `SPACE`s store a lot more than tabular data).
|
||||
|
||||
A project which is powered by the community believes in the power of community! If you get stuck anywhere - here are your options!
|
||||
**With the REPL started, follow this guide**:
|
||||
|
||||
<html>
|
||||
<a href="https://gitter.im/skytable/community"><img src="https://img.shields.io/badge/chat%20on-gitter-ed1965?logo=gitter&style=flat-square"></img>
|
||||
</a><a href="https://discord.gg/QptWFdx"><img src="https://img.shields.io/badge/talk-on%20discord-7289DA?logo=discord&style=flat-square"></img></a>
|
||||
</html>
|
||||
1. Create a `space` and switch to it:
|
||||
```sql
|
||||
CREATE SPACE myspace
|
||||
USE myspace
|
||||
```
|
||||
2. Create a `model`:
|
||||
```sql
|
||||
CREATE MODEL myspace.mymodel(username: string, password: string, notes: list { type: string })
|
||||
```
|
||||
The rough representation for this in Rust would be:
|
||||
```rust
|
||||
pub struct MyModel {
|
||||
username: String,
|
||||
password: Strin,
|
||||
notes: Vec<String>,
|
||||
}
|
||||
```
|
||||
3. `INSERT` some data:
|
||||
```sql
|
||||
INSERT INTO mymodel('sayan', 'pass123', [])
|
||||
```
|
||||
4. `UPDATE` some data:
|
||||
```sql
|
||||
UPDATE mymodel SET notes += "my first note" WHERE username = 'sayan'
|
||||
```
|
||||
5. `SELECT` some data
|
||||
```sql
|
||||
SELECT * FROM mymodel WHERE username = 'sayan'
|
||||
```
|
||||
6. Poke around! **And then make sure you [read the documentation learn BlueQL](https://docs.skytable.io/blueql/overview).**
|
||||
|
||||
## Platforms 💻
|
||||
> **For a complete guide on Skytable, it's architecture, BlueQL, queries and more we strongly recommend you to [read the documentation here.](https://docs.skytable.io)**
|
||||
>
|
||||
> While you're seeing strings and other values being used here, this is so because the REPL client smartly parameterizes queries behind the scenes. **BlueQL has mandatory parameterization**. (See below to see how the Rust client handles this)
|
||||
|
||||
![Linux supported](https://img.shields.io/badge/Linux%2032--bit%2F64--bit-Supported%20✓-%23228B22?logo=linux) ![macOS supported](https://img.shields.io/badge/macOS%20x86__64%2Farm64-supported%20✓-228B22?style=flat-square&logo=apple) ![Windows supported](https://img.shields.io/badge/Windows%2032--bit%2F64--bit-supported%20✓-228B22?style=flat-square&logo=windows)
|
||||
## 🧩 Find a client driver
|
||||
|
||||
## Versioning
|
||||
You need a client driver to use Skytable in your programs. Officially, we maintain a regularly updated [Rust client driver](https://github.com/skytable/client-rust) which is liberally license under the Apache-2.0 license so that you can use it anywhere.
|
||||
|
||||
This project strictly follows semver, however, since this project is currently in the development phase (0.x.y), the API may change unpredictably
|
||||
Using the Rust client driver, it's very straightforward to run queries thanks to Rust's powerful type system and macros:
|
||||
|
||||
## Contributing
|
||||
```rust
|
||||
use skytable::{Config, query};
|
||||
|
||||
fn main() {
|
||||
let mut db = Config::new_default("username", "password").connect().unwrap();
|
||||
let query = query!("select username, password from myspace.mymodel where username = ?", "sayan");
|
||||
let (username, password): (String, Vec<u8>) = db.query_parse(&query).unwrap();
|
||||
// do something with it!
|
||||
}
|
||||
```
|
||||
|
||||
> **You can find more information on client drivers on [this page](https://docs.skytable.io/libraries). If you want to help write a client driver for your language of choice, *we're here to support your work*. Please reach out to: hey@skytable.io or leave a message on our Discord server!**
|
||||
|
||||
## 🙋 Getting help
|
||||
|
||||
[![Contribute Now](https://img.shields.io/badge/%F0%9F%8C%9Fcontribute-now-a94064?style=for-the-badge)](https://ohsayan.github.io/skythanks)
|
||||
We exclusively use [Discord](https://discord.gg/QptWFdx) for most real-time communications — you can chat with developers, maintainers, and our amazing users! Outside that, we recommend that you use our [GitHub Discussions page](https://github.com/skytable/skytable/discussions) for any questions or open a new issue if you think you've found a bug.
|
||||
|
||||
*We're here to help!*
|
||||
|
||||
## Contributing
|
||||
|
||||
You are welcome to contribute to Skytable! Beginner friendly issues are marked with the [<img src=https://img.shields.io/badge/L--easy-C71585>](https://github.com/skytable/skytable/labels/L-easy) label. Read the guide [here](./CONTRIBUTING.md).
|
||||
Please read the [contributing guide here](./CONTRIBUTING.md).
|
||||
|
||||
## Contributors
|
||||
## Acknowledgements
|
||||
|
||||
You can see a full list of contributors [here](https://ohsayan.github.io/skythanks)
|
||||
Please read the [acknowledgements](./ACKNOWLEDGEMENTS.txt) document.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the [AGPL-3.0 License](./LICENSE).
|
||||
Skytable is distributed under the [AGPL-3.0 License](./LICENSE). **You may not use Skytable's logo for other projects.**
|
||||
|
@ -1,380 +0,0 @@
|
||||
#
|
||||
# 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 <ohsayan@outlook.com>
|
||||
#
|
||||
# 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 <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
#
|
||||
#
|
||||
# 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 <message>]
|
||||
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 <entity>]
|
||||
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 <SNAPNAME>]
|
||||
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 `<SNAPNAME>` 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 <entity>]
|
||||
desc: Removes all entries stored in the current table or in the provided entity
|
||||
return: [Rcode 0, Rcode 5]
|
||||
- name: WHEREAMI
|
||||
complexity: O(1)
|
||||
accept: [AnyArray]
|
||||
syntax: [WHEREAMI]
|
||||
desc: |
|
||||
Returns an array with either the name of the current keyspace as the first element or if a default table
|
||||
is set, then it returns the keyspace name as the first element and the table name as the second element
|
||||
return: [Non-null array]
|
||||
- name: AUTH
|
||||
desc: Change global authn/authz settings
|
||||
subactions:
|
||||
- name: LOGIN
|
||||
complexity: O(1)
|
||||
accept: [AnyArray]
|
||||
syntax: [AUTH LOGIN <username> <token>]
|
||||
desc: Attempts to log in using the provided credentials
|
||||
return: [Rcode 0, Rcode 10]
|
||||
- name: CLAIM
|
||||
complexity: O(1)
|
||||
accept: [AnyArray]
|
||||
syntax: [AUTH CLAIM <origin key>]
|
||||
desc: Attempts to claim the root account using the origin key
|
||||
return: [String, Rcode 10]
|
||||
- name: LOGOUT
|
||||
complexity: O(1)
|
||||
accept: [AnyArray]
|
||||
syntax: [AUTH LOGOUT]
|
||||
desc: Attempts to log out the currently logged in user
|
||||
return: [Rcode 0, Rcode 10]
|
||||
- name: ADDUSER
|
||||
complexity: O(1)
|
||||
accept: [AnyArray]
|
||||
syntax: [AUTH ADDUSER <username>]
|
||||
desc: Attempts to create a new user with the provided username, returning the token
|
||||
return: [String, Rcode 11]
|
||||
- name: DELUSER
|
||||
complexity: O(1)
|
||||
accept: [AnyArray]
|
||||
syntax: [AUTH DELUSER <username>]
|
||||
desc: Attempts to delete the user with the provided username
|
||||
return: [Rcode 0, Rcode 10, Rcode 11]
|
||||
- name: RESTORE
|
||||
complexity: O(1)
|
||||
accept: [AnyArray]
|
||||
syntax: [AUTH RESTORE <username>, AUTH RESTORE <origin-key> <username>]
|
||||
desc: |
|
||||
Attempts to restore the password for the provided user. This will regenerate the token
|
||||
and return the newly issued token. However, if you aren't a root account, that is, you
|
||||
lost your root password, then you'll need to run `AUTH RESTORE <origin-key> root`.
|
||||
return: [String, Rcode 10, Rcode 11]
|
||||
- name: LISTUSER
|
||||
complexity: O(1)
|
||||
accept: [AnyArray]
|
||||
syntax: [AUTH LISTUSER]
|
||||
desc: |
|
||||
Attempts to return a list of users for the current database instance
|
||||
return: [Non-null array]
|
||||
- name: WHOAMI
|
||||
complexity: O(1)
|
||||
accept: [AnyArray]
|
||||
syntax: [AUTH WHOAMI]
|
||||
desc: |
|
||||
Returns a string with the AuthID of the currently logged in user or errors if the user
|
||||
is not logged in
|
||||
return: [String]
|
||||
- name: SYS
|
||||
desc: |
|
||||
Get system information and metrics
|
||||
subactions:
|
||||
- name: INFO
|
||||
complexity: O(1)
|
||||
accept: [AnyArray]
|
||||
syntax: [sys info <property>]
|
||||
return: [String, Float]
|
||||
desc: |
|
||||
Returns static properties of the system, i.e properties that do not change during runtime.
|
||||
The following properties are available:
|
||||
- `version`: Returns the server version (String)
|
||||
- `protocol`: Returns the protocol version string (String)
|
||||
- `protover`: Returns the protocol version (float)
|
||||
- name: METRIC
|
||||
complexity: O(1)
|
||||
accept: [AnyArray]
|
||||
syntax: [sys metric <metric>]
|
||||
return: [String, Float]
|
||||
desc: |
|
||||
Returns dynamic properties of the system, i.e metrics are properties that can change during
|
||||
runtime. The following metrics are available:
|
||||
- `health`: Returns "good" or "critical" depending on the system state (String)
|
||||
- `storage`: Returns bytes used for on-disk storage (uint64)
|
||||
|
||||
keyvalue:
|
||||
generic:
|
||||
- name: DEL
|
||||
complexity: O(n)
|
||||
accept: [AnyArray]
|
||||
syntax: [DEL <key1> <key2> ...]
|
||||
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 <key1> <key2> ...]
|
||||
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 <limit>, LSKEYS <entity>, LSKEYS <entity> <limit>]
|
||||
desc: |
|
||||
Returns a flat string array of keys present in the current table or in the provided entity.
|
||||
If no `<limit>` is given, then a maximum of 10 keys are returned. If a limit is specified,
|
||||
then a maximum of `<limit>` keys are returned. The order of keys is meaningless.
|
||||
return: [Typed Array]
|
||||
string:
|
||||
- name: GET
|
||||
complexity: O(1)
|
||||
accept: [AnyArray]
|
||||
syntax: [GET <key>]
|
||||
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 <key1> <key2> ...]
|
||||
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 <key> <value>]
|
||||
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 <key1> <value1> <key2> <value2> ...]
|
||||
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 <key> <value>]
|
||||
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 <key1> <value1> <key2> <value2> ...]
|
||||
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 <key1> <value1> <key2> <value2> ...]
|
||||
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 <key1> <key2> ...]
|
||||
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 <key1> <value1> <key2> <value2> ...]
|
||||
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 <key1> <value1> <key2> <value2> ...]
|
||||
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 <key>]
|
||||
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 <key>]
|
||||
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 <key1> <key2> ...]
|
||||
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 <list>]
|
||||
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 <list> limit <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 <list> len]
|
||||
desc: Returns the length of the list
|
||||
return: [Integer, Rcode 1]
|
||||
- name: valueat
|
||||
complexity: O(1)
|
||||
accept: [AnyArray]
|
||||
syntax: [LGET <list> valueat <index>]
|
||||
desc: Returns the element present at the provided `index`, if it exists in the given list.
|
||||
return: [String, binstr, Rcode 1, bad-list-index]
|
||||
- name: first
|
||||
complexity: O(1)
|
||||
accept: [AnyArray]
|
||||
syntax: [LGET <list> 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 <list> last]
|
||||
desc: Returns the last element present in the list, if it exists.
|
||||
return: [String, binstr, Rcode 1, list-is-empty]
|
||||
- name: range
|
||||
complexity: O(n)
|
||||
accept: [AnyArray]
|
||||
syntax: [LGET <list> range <start>, LGET <list> range <start> <stop>]
|
||||
desc: |
|
||||
Returns items in the given range. If no value for `stop` is provided, all the elements from that
|
||||
index are returned. If a value for `stop` is provided, then a subarray is returned
|
||||
return: [Typed Array, Rcode 1, bad-list-index]
|
||||
- name: LMOD
|
||||
desc: |
|
||||
`LMOD` can be used to mutate the elements in a list
|
||||
subactions:
|
||||
- name: push
|
||||
complexity: O(1)
|
||||
accept: [AnyArray]
|
||||
syntax: [LMOD <list> push <v1> <v2> ...]
|
||||
desc: Appends the elements to the end of the provided list, if it exists.
|
||||
return: [Rcode 0, Rcode 1, Rcode 5]
|
||||
- name: insert
|
||||
complexity: O(1)
|
||||
accept: [AnyArray]
|
||||
syntax: [LMOD <list> insert <index> <value>]
|
||||
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 <list> pop, LMOD <list> pop <index>]
|
||||
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 1, Rcode 5, bad-list-index]
|
||||
- name: remove
|
||||
complexity: O(1)
|
||||
accept: [AnyArray]
|
||||
syntax: [LMOD <list> remove <index>]
|
||||
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 <list> 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 <list>, LSET <list> <value1> <value2> ...]
|
||||
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 2, Rcode 5]
|
Binary file not shown.
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 180 KiB |
@ -0,0 +1,14 @@
|
||||
# this is the default configuration for the Debian package. Modify to use your own settings.
|
||||
system:
|
||||
mode: prod
|
||||
rs_window: 300
|
||||
|
||||
auth:
|
||||
plugin: pwd
|
||||
# replace with your root password of choice
|
||||
root_pass: rootpass
|
||||
|
||||
endpoints:
|
||||
insecure:
|
||||
host: 127.0.0.1
|
||||
port: 2003
|
@ -1,15 +1,35 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
SKY_DIR=/var/lib/skytable
|
||||
systemctl daemon-reload
|
||||
|
||||
if [ $1 = "install" ]; then
|
||||
echo "Doing '$1'"
|
||||
if [ "$1" = "configure" ]; then
|
||||
# Enable and start skyd on fresh install
|
||||
systemctl enable skyd
|
||||
fi
|
||||
systemctl start skyd
|
||||
echo "Generating password and configuration"
|
||||
|
||||
if [ $1 = "upgrade" ]; then
|
||||
if [ -f /var/lib/skytable/config.yaml ]; then
|
||||
echo "Configuration already exists. Not updating configuration."
|
||||
else
|
||||
mv /var/lib/skytable/config.yaml.tmp /var/lib/skytable/config.yaml
|
||||
# Generate and set password
|
||||
if [ ! -f "$SKY_DIR/config.yaml" ]; then
|
||||
echo "Error: The file $SKY_DIR/config.yaml does not exist."
|
||||
exit 1 # Exit with an error code
|
||||
fi
|
||||
PASSWORD=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 16 ; echo '')
|
||||
sed -i "s/rootpass/$PASSWORD/g" "$SKY_DIR/config.yaml"
|
||||
echo "Your root password is: '$PASSWORD'. You can change this using the config file in $SKY_DIR/config.yaml"
|
||||
fi
|
||||
elif [ "$1" = "upgrade" ]; then
|
||||
# On upgrade, just restart skyd
|
||||
echo "Not changing configuration. This is an upgrade."
|
||||
systemctl stop skyd
|
||||
systemctl start skyd
|
||||
fi
|
||||
|
||||
systemctl start skyd
|
||||
echo "Done executing post install scripts."
|
||||
|
||||
#DEBHELPER#
|
@ -0,0 +1,27 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
SKY_DIR=/var/lib/skytable
|
||||
SERVICE_NAME=skyd
|
||||
|
||||
# Only perform cleanup on package removal, not on upgrade
|
||||
case "$1" in
|
||||
remove)
|
||||
echo "Removing the skytable user..."
|
||||
# Remove the user and group, if they exist
|
||||
# This will not remove the /var/lib/skytable directory
|
||||
if getent passwd skytable > /dev/null; then
|
||||
deluser --system skytable
|
||||
fi
|
||||
if getent group skytable > /dev/null; then
|
||||
delgroup skytable
|
||||
fi
|
||||
echo "Removing the configuration file ..."
|
||||
rm /var/lib/skytable/config.yaml
|
||||
echo "Cleanup complete."
|
||||
;;
|
||||
*)
|
||||
# No action required for other cases (upgrade, failed-upgrade, etc.)
|
||||
;;
|
||||
esac
|
||||
|
||||
#DEBHELPER#
|
@ -0,0 +1,6 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
echo "Stopping processes"
|
||||
systemctl stop skyd
|
||||
systemctl disable skyd
|
||||
echo "Stopped processes"
|
Loading…
Reference in New Issue