Skip to content

Commit d35220b

Browse files
authored
Merge pull request #125 from skytable/0.8.4/init
docs: Add 0.8.4 docs
2 parents b52cc01 + 48c9e37 commit d35220b

19 files changed

+119
-45
lines changed

docs/a.installation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ However, we strongly recommend **not** using it outside testing environments.
2020

2121
To use native binaries you need to download a bundle which is simply a ZIP file with all the necessary binaries that you'll ever need to develop on and deploy Skytable.
2222

23-
1. **First download the latest bundle** for your platform. You can find [download links on the releases page](https://github.com/skytable/skytable/releases/v0.8.3).
23+
1. **First download the latest bundle** for your platform. You can find [download links on the releases page](https://github.com/skytable/skytable/releases/v0.8.4).
2424
2. **Unzip the ZIP file**. You'll find the following binaries in the extracted archive:
2525
- `skyd`: This is the database server binary which when started runs as a daemon, serving requests
2626
- `skysh`: This is the Skytable shell and it provides a very helpful interactive REPL database client
@@ -72,7 +72,7 @@ The package will:
7272
2. **Start the container**:
7373
7474
```shell
75-
docker run -d --name skydb -p 2003:2003 skytable/skytable:v0.8.3
75+
docker run -d --name skydb -p 2003:2003 skytable/skytable:v0.8.4
7676
```
7777
7878
:::tip
@@ -85,14 +85,14 @@ message with the generated password.
8585
1. **Download the bundle**: To be able to run queries you need to download the bundle as described above
8686
2. **Create the data directory**: To ensure that our database is persistent and all our data doesn't vanish as soon as the container is terminated, we'll map the data directory to an actual directory on our local system.
8787
> **Note:** Create a folder called `skytable` in a convenient location. We recommend having a directory in `$HOME/docker-containers` where you can store the Skytable container's data and any other containers that you might use. It's a great way to keep things organized.
88-
3. **Create your configuration**: [Download this template file](https://raw.githubusercontent.com/skytable/skytable/v0.8.3/examples/config-files/template.yaml) and place it into the directory you created. Update the password with your `root` password of choice.
88+
3. **Create your configuration**: [Download this template file](https://raw.githubusercontent.com/skytable/skytable/v0.8.4/examples/config-files/template.yaml) and place it into the directory you created. Update the password with your `root` password of choice.
8989
4. **Start the container**:
9090

9191
```shell
9292
docker run -d --name skydb \
9393
-v $HOME/docker-containers/skytable:/var/lib/skytable \
9494
-p 2003:2003 \
95-
skytable/skytable:v0.8.3
95+
skytable/skytable:v0.8.4
9696
```
9797

9898
Explanation:

docs/b.using-repl.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,20 @@ CREATE MODEL myspace.mymodel(username: string, password: string, notes: list { t
7373

7474
### Add, update and remove some data
7575

76-
- **Insert some data**:
76+
- **Insert some data**:
77+
7778
```sql
7879
INSERT INTO myspace.mymodel('sayan', 'password123', [])
7980
```
81+
8082
- **Update some data**:
83+
8184
```sql
8285
UPDATE myspace.mymodel SET notes += "mynewnote" WHERE username = 'sayan'
8386
```
87+
8488
- **Select some data**:
89+
8590
```sql
8691
SELECT notes, password FROM myspace.mymodel WHERE username = 'sayan'
8792
```

docs/blueql/1.overview.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ id: overview
66
In this document we explore some of the meta parts of BlueQL. If you want to look at how you can use BlueQL, consider looking at the sections that follow.
77

88
Design principles:
9+
910
- **Simplicity and clarity**: The language shouldn't be overwhelming to understand
1011
- **Security with mandatory parameterization**: We want to reduce the surface of injection attacks. For this reason, [parameterization is mandatory](#parameters).
1112

@@ -18,17 +19,18 @@ Just like SQL, BlueQL has three categories of commands/queries inside it:
1819
Jump to [differences from SQL](#differences-from-sql).
1920

2021
:::info
21-
This text is *not* a detailed, formal guide. It's meant for developers and users who want to work with
22-
Skytable. If you need a more formal specification, like a grammar definition, please ask us, and we'll create
22+
This text is *not* a detailed, formal guide. It's meant for developers and users who want to work with
23+
Skytable. If you need a more formal specification, like a grammar definition, please ask us, and we'll create
2324
it. We haven't published it yet because no one has requested it.
2425
:::
2526

2627
## Identifiers
28+
2729
Can begin with any ASCII alphabet or an underscore (`_`) and then have any number of alphanumeric characters and/or underscores.
2830

2931
## Keywords
3032

31-
Keywords are identifiers with special meanings and hence can't be used as identifiers in other places. Here's a full-list of
33+
Keywords are identifiers with special meanings and hence can't be used as identifiers in other places. Here's a full-list of
3234
keywords:
3335

3436
```ts
@@ -45,6 +47,7 @@ keywords:
4547
## Data types
4648

4749
### Boolean
50+
4851
A boolean value, either `true` or `false`
4952

5053
### Unsigned integers
@@ -75,9 +78,11 @@ A boolean value, either `true` or `false`
7578

7679
- `list`: a list of any of the data types, including nested lists
7780
- A list is represented as: `[]` with values inbetween. For example, a `list { type:string }` would be represented as:
81+
7882
```sql
7983
["sayan", "loves", "dogs"]
8084
```
85+
8186
- **Lists cannot contain null values**
8287
- **List can be nested**: You can have heavily nested lists like: `[[[]], [["another one"]]]`
8388
- **List can only have one base type**: This means that if you have a list like `[[[string]]]` each element must either be the same nested list, or an empty list
@@ -100,6 +105,7 @@ New data types are frequently added, so treat this list as non-exhaustive.
100105
101106
:::warning Literals are not available everywhere
102107
It is very important for you to know that literals are not allowed everywhere. The only literals allowed everywhere are:
108+
103109
- Lists
104110
- Dictionaries
105111
@@ -150,6 +156,7 @@ On a final note, BlueQL doesn't support comments of any form also for security r
150156
## DDL
151157

152158
Queries include:
159+
153160
- Spaces:
154161
- `CREATE SPACE myspace [WITH { property: value, ... }]`
155162
- `ALTER SPACE myspace [WITH { property: updated_value, ... }]`
@@ -172,6 +179,7 @@ Queries include:
172179
## DCL
173180

174181
Queries include:
182+
175183
- `SYSCTL REPORT STATUS`: returns the status of the system. (Not a control query per se)
176184
- `SYSCTL CREATE USER "username" WITH { password: ... }`: create a new user
177185
- `SYSCTL DROP USER "username"`: removes the user in question

docs/blueql/2.ddl.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,27 @@ This is so that you're specific about what DDL object you want to manipulate.
2222
Exception: `INSPECT` queries will respect the currently set `SPACE` if required.
2323
:::
2424

25-
### INSPECT:
25+
### INSPECT
2626

2727
- **Syntax**:
2828
- `INSPECT GLOBAL`: returns a JSON with a list of all spaces, users and other information. For example:
29+
2930
```json
3031
{"spaces":["space1"],"users":["root"],"settings":{}}
3132
```
33+
3234
- `INSPECT SPACE <space>`: returns a JSON with a list of all models in the space and other information, For example:
35+
3336
```json
3437
{"models":["model1"],"properties":{}}
3538
```
39+
3640
- `INSPECT MODEL <space>.<model>`: returns a JSON with information about the model such as the declaration, row count and such:
41+
3742
```json
3843
{"decl":"{*username: string, !password: string, ?notes: [string]}","size":12345678,"properties":{}}
3944
```
45+
4046
- **Access control**: any
4147
- **Returns**: string or error
4248

@@ -68,8 +74,8 @@ CREATE SPACE IF NOT EXISTS apps
6874

6975
### ALTER SPACE
7076

71-
7277
**Syntax:**
78+
7379
```sql
7480
ALTER SPACE <space_name> WITH { property_name: property_value }
7581
```
@@ -87,6 +93,7 @@ ALTER SPACE apps WITH { new_cache_value: 1234 }
8793
### DROP SPACE
8894

8995
**Syntax:**
96+
9097
```sql
9198
DROP SPACE [IF EXISTS] [ALLOW NOT EMPTY] <space_name>
9299
```
@@ -96,9 +103,11 @@ DROP SPACE [IF EXISTS] [ALLOW NOT EMPTY] <space_name>
96103
- **A non-empty space cannot be dropped**
97104
To avoid catastrophic `DROP`s, a `SPACE` can only be dropped directly if it is non-empty. To drop a non-empty space, you must
98105
run:
106+
99107
```sql
100108
DROP SPACE ALLOW NOT EMPTY <space_name>
101109
```
110+
102111
- **Returns**:
103112
- empty or error
104113
- when used with `if exists`: bool indicating whether the space was actually present or not
@@ -126,9 +135,11 @@ DROP SPACE ALLOW NOT EMPTY myspace
126135
### CREATE MODEL
127136

128137
**Syntax**:
138+
129139
```sql
130140
CREATE MODEL [IF NOT EXISTS] <space_name>.<model_name>([primary] [null] field_name: field_type) [ WITH {property_name: property_value} ]
131141
```
142+
132143
- **Access control**: `root` only
133144
- **Properties**: None
134145
- **Operational notes**:
@@ -151,6 +162,7 @@ CREATE MODEL IF NOT EXISTS myspace.mymodel(username: string, password: string, n
151162
### ALTER MODEL ADD
152163

153164
**Syntax:**
165+
154166
```sql
155167
-- add a single field
156168
ALTER MODEL <space_name>.<model_name> ADD one_field { type: string }
@@ -165,6 +177,7 @@ ALTER MODEL <space_name>.<model_name> ADD (
165177
- **Returns**: empty or error
166178

167179
#### Examples
180+
168181
```sql
169182
ALTER MODEL myspace.mymodel ADD one_field { type: list { type: string } }
170183
ALTER MODEL myspace.mymodel ADD (
@@ -182,6 +195,7 @@ ALTER MODEL myspace.mymodel ADD (
182195
### ALTER MODEL UPDATE
183196

184197
**Syntax**
198+
185199
```sql
186200
-- update one field
187201
ALTER MODEL <space_name>.<model_name> UPDATE one_field { type: string }
@@ -210,6 +224,7 @@ ALTER MODEL myspace.mymodel UPDATE (
210224
### ALTER MODEL REMOVE
211225

212226
**Syntax**:
227+
213228
```sql
214229
-- remove one field
215230
ALTER MODEL <space_name>.<model_name> REMOVE one_field
@@ -232,6 +247,7 @@ ALTER MODEL myspace.mymodel REMOVE (useless_field_1, useless_field2)
232247
### DROP MODEL
233248

234249
**Syntax**:
250+
235251
```sql
236252
DROP MODEL [IF EXISTS] [ALLOW NOT EMPTY] <space_name>.<model_name>
237253
```
@@ -240,9 +256,11 @@ DROP MODEL [IF EXISTS] [ALLOW NOT EMPTY] <space_name>.<model_name>
240256
- **Operational notes**
241257
- **Non-empty models cannot be dropped** to avoid catastrophic drops
242258
- **To drop a non-empty model**: you must run:
259+
243260
```sql
244261
DROP MODEL ALLOW NOT EMPTY <space_name>.<model_name>
245262
```
263+
246264
- **Returns**:
247265
- empty or error
248266
- when used with `if exists`: bool indicating whether the model was actually present or not
@@ -253,3 +271,22 @@ DROP MODEL [IF EXISTS] [ALLOW NOT EMPTY] <space_name>.<model_name>
253271
DROP MODEL myspace.mymodel
254272
DROP ALLOW NOT EMPTY myspace.mymodel
255273
```
274+
275+
### TRUNCATE MODEL
276+
277+
```sql
278+
TRUNCATE MODEL <space_name>.<model_name>
279+
```
280+
281+
- **Access control**: `root` only
282+
- **Operational notes**:
283+
- Blocking
284+
- Blocks all DML queries until completion of execution
285+
- **Returns**:
286+
- empty or error
287+
288+
#### Examples
289+
290+
```sql
291+
TRUNCATE MODEL myspace.mymodel
292+
```

docs/blueql/3.dml.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ INSERT INTO <model_name> {
2828
...
2929
}
3030
```
31+
3132
### Requirements and responses
3233

3334
- **Access control**: any

docs/blueql/4.dcl.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ id: dcl
33
title: DCL
44
---
55

6-
Data Control Language or DCL can be used to perform administrative tasks on the database. Currently, all DCL commands are
6+
Data Control Language or DCL can be used to perform administrative tasks on the database. Currently, all DCL commands are
77
available under the `SYSCTL` query.
88

99
## SYSCTL REPORT STATUS
1010

1111
**Syntax**:
12+
1213
```sql
1314
SYSCTL REPORT STATUS
1415
```
16+
1517
- **Access control**: any
1618
- **Operational notes**:
1719
- This returns the current overall health of the system
@@ -20,15 +22,18 @@ SYSCTL REPORT STATUS
2022
## SYSCTL CREATE USER
2123

2224
**Syntax**:
25+
2326
```sql
2427
SYSCTL CREATE USER <username> WITH { password: 'password' }
2528
```
29+
2630
- **Access control**: `root` only
2731
- **Returns**: empty or error
2832

2933
## SYSCTL ALTER USER
3034

3135
**Syntax**:
36+
3237
```sql
3338
SYSCTL ALTER USER <username> WITH { password: 'new password' }
3439
```
@@ -44,8 +49,10 @@ Trying to change the `root` account password will throw an error. You can only c
4449
## SYSCTL DROP USER
4550

4651
**Syntax**:
52+
4753
```sql
4854
SYSCTL DROP USER <username>
4955
```
56+
5057
- **Access control**: `root` only
5158
- **Returns**: empty or error

0 commit comments

Comments
 (0)