Additions
- **Multiple keyspaces**:
- Keyspaces hold multiple tables and determine the replication strategy
- Keyspaces can be created with:
sql
CREATE KEYSPACE <name>
- The `system` keyspace is reserved for the system while the `default` keyspace is
the one available by default. The `system` or `default` keyspace cannot be removed
- Keyspaces can be deleted with:
sql
DROP KEYSPACE <name>
- If a keyspace still has tables, it cannot be dropped by using `DROP KEYSPACE <name>`, instead
one needs to use `DROP KEYSPACE <name> force` to force drop the keyspace
- **Multiple tables**:
- Tables hold the actual data. When you connect to the server, you are connected to the `default`
table in the `default` keyspace. This table is non-removable
- Tables can be created with:
sql
CREATE TABLE <entity> <model>(modelargs) <properties>
- Tables can be dropped with:
sql
DROP TABLE <entity>
- **Entity groups**: While using DDL queries and inspection queries, we can use the _Fully Qualified Entity_ (FQE) syntax instead of the table name. For example, to `inspect` the `cyan` table in keyspace `supercyan`, one can simply run:
sql
INSPECT TABLE supercyan:cyan
The syntax is:
sql
keyspace:table
**Note**: Both keyspaces and tables are entities. The names of entities must:
- Begin with an underscore (\_) or an ASCII alphabet
- Not begin with a number (0-9)
- Must have lesser than 64 characters
- **Keymap data model**:
- To create a keymap table, run:
sql
CREATE TABLE <entity> keymap(<type>,<type>)
- The following types were introduced:
- `str`: A valid unicode string
- `binstr`: A binary string
- **Volatile table property**:
- To create a volatile table, irrespective of the data model, run:
sql
CREATE TABLE <entity> <model>(modelargs) volatile
- Volatile tables always exist, but the data in them does not persist between restarts. This makes them extremely useful for caches
- **Inspection**:
- Keyspaces can be inspected with:
sql
INSPECT KEYSPACE <name>
This will list all the tables in the keyspace
- Tables can be inspected with:
sql
INSPECT TABLE <entity>
This will give information about the data model and other properties of the table
- To list all keyspaces, this can be run:
sql
INSPECT KEYSPACES
- **Cyanstore 1A disk storage format**: Cyanstore (v1A) was a new storage format built for the multi-keyspace-table world. It efficiently stores and retrieves records, tables and keyspaces
- **Realtime keyspace/table switch**
- To switch to a new keyspace in real-time, one needs to run:
sql
USE keyspace
- To switch to a new table in real-time, one needs to run:
sql
USE keyspace:table
- **Entity respecting actions**:
- **`FLUSHDB`**: To flush all the data in a specific table, run:
sql
FLUSHDB <entity>
- **`DBSIZE`**: To see the number of entries in a specific table, run:
sql
DBSIZE <entity>
- **`LSKEYS`**:
- `LSKEYS` will return keys from the current table
- `LSKEYS <count>` will return _count_ keys from the current table
- `LSKEYS <entity>` will return keys from the given table
- `LSKEYS <entity> <count>` will return _count_ keys from the given table
- **Snapshot isolation for strong actions**: This makes strong actions
extremely reliable when compared to the earlier releases
- Non-interactive TLS private key passphrase input: Just save your password in some
file and then pass `--tlspassin /path/to/passfile.txt`. You can do the same by using the
`tlspassin` key under SSL in the configuration file
- `MPOP` now replaces `POP` to accept multiple keys while `POP` will accept a single key
to follow the `MGET`/`GET` naming convention
- TLS port can now be set to a custom port via CLI arguments
- `sky-bench` can now run multiple times to get average values through the `--runs` option
- `HEYA` now does an echo with the second argument
Fixes
- Zero length argument causing runtime panic in `skysh`
- `HEYA!` not reporting errors on incorrect number of arguments
- Panic on incorrect data type in `skyd`
- `sky-bench` no longer affects your personal data because it creates a random temporary table
under the `default` keyspace
- `sky-bench`'s `testkey` subcommand causing key collisions
- Fix log output in `sky-bench` even if the `--json` flag was passed
- Use flocks to enable auto release of pid file, even if process is forcefully terminated
- Fixes [CVE-2021-37625](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-37625)
Breaking
- All actions now accept the `AnyArray` type introduced in Skyhash 1.1
- `POP` now accepts one key while `MPOP` accepts multiple keys
- Disk storage format has changed
- The `upgrade` subcommand has been removed