Skip to content

Commit f24e403

Browse files
committed
docs: seperate json docs into reference guide
1 parent 06a4529 commit f24e403

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+925
-646
lines changed

README.md

+25-64
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# Encrypt Query Language (EQL)
22

3-
[![Why we built EQL](https://img.shields.io/badge/concept-Why%20EQL-8A2BE2)](https://github.com/cipherstash/encrypt-query-language/blob/main/docs/concepts/WHY.md)
4-
[![Getting started](https://img.shields.io/badge/guide-Getting%20started-008000)](https://github.com/cipherstash/encrypt-query-language/blob/main/docs/tutorials/GETTINGSTARTED.md)
5-
[![CipherStash Proxy](https://img.shields.io/badge/guide-CipherStash%20Proxy-A48CF3)](https://github.com/cipherstash/encrypt-query-language/blob/main/docs/tutorials/PROXY.md)
6-
[![CipherStash Migrator](https://img.shields.io/badge/guide-CipherStash%20Migrator-A48CF3)](https://github.com/cipherstash/encrypt-query-language/blob/main/docs/reference/MIGRATOR.md)
3+
[![Test EQL](https://github.com/cipherstash/encrypt-query-language/actions/workflows/test-eql.yml/badge.svg?branch=main)](https://github.com/cipherstash/encrypt-query-language/actions/workflows/test-eql.yml)
4+
[![Release EQL](https://github.com/cipherstash/encrypt-query-language/actions/workflows/release-eql.yml/badge.svg?branch=main)](https://github.com/cipherstash/encrypt-query-language/actions/workflows/release-eql.yml)
75

86
Encrypt Query Language (EQL) is a set of abstractions for transmitting, storing, and interacting with encrypted data and indexes in PostgreSQL.
97

@@ -18,6 +16,7 @@ Store encrypted data alongside your existing data.
1816

1917
- [Installation](#installation)
2018
- [CipherStash Proxy](#cipherstash-proxy)
19+
- [Documentation](#documentation)
2120
- [Getting started](#getting-started)
2221
- [Enable encrypted columns](#enable-encrypted-columns)
2322
- [Configuring the column](#configuring-the-column)
@@ -37,7 +36,6 @@ Store encrypted data alongside your existing data.
3736
- [Inserting JSON data](#inserting-json-data)
3837
- [Reading JSON data](#reading-json-data)
3938
- [Advanced JSON queries](#advanced-json-queries)
40-
- [EQL payload data format](#eql-payload-data-format)
4139
- [Frequently Asked Questions](#frequently-asked-questions)
4240
- [How do I integrate CipherStash EQL with my application?](#how-do-i-integrate-cipherstash-eql-with-my-application)
4341
- [Can I use EQL without the CipherStash Proxy?](#can-i-use-eql-without-the-cipherstash-proxy)
@@ -68,6 +66,10 @@ The simplest way to get up and running with EQL is to execute the install SQL fi
6866
EQL relies on [CipherStash Proxy](https://github.com/cipherstash/encrypt-query-language/blob/main/PROXY.md) for low-latency encryption & decryption.
6967
We plan to support direct language integration in the future.
7068

69+
## Documentation
70+
71+
You can read more about the EQL concepts and reference guides in the [documentation directory](https://github.com/cipherstash/encrypt-query-language/tree/main/docs).
72+
7173
## Getting started
7274

7375
Once the custom types and functions are installed, you can start using EQL in your queries.
@@ -121,7 +123,7 @@ When connected to the database directly, it is a no-op.
121123

122124
Encrypted data is stored as `jsonb` values in the database, regardless of the original data type.
123125

124-
You can read more about the data format [here][#data-format].
126+
You can read more about the data format [here](docs/reference/PAYLOAD.md).
125127

126128
### Inserting Data
127129

@@ -201,7 +203,7 @@ SELECT cs_add_index_v1(
201203
);
202204
```
203205

204-
You can read more about the index configuration options [here][https://github.com/cipherstash/encrypt-query-language/blob/main/docs/reference/INDEX.md].
206+
You can read more about the index configuration options [here](docs/reference/INDEX.md).
205207

206208
**Example (Unique index):**
207209

@@ -396,7 +398,7 @@ Data is stored in the database as:
396398
"k": "sv",
397399
"v": 1,
398400
"sv": [
399-
...ciphertext...
401+
["ciphertext"]
400402
]
401403
}
402404
```
@@ -429,59 +431,7 @@ Data is returned as:
429431
### Advanced JSON queries
430432

431433
We support a wide range of JSON/JSONB functions and operators.
432-
You can read more about the JSONB support in the [JSONB reference guide](https://github.com/cipherstash/encrypt-query-language/blob/main/docs/reference/JSON.md).
433-
434-
## EQL payload data format
435-
436-
Encrypted data is stored as `jsonb` with a specific schema:
437-
438-
- **Plaintext payload (client side):**
439-
440-
```json
441-
{
442-
"v": 1,
443-
"k": "pt",
444-
"p": "plaintext value",
445-
"e": {
446-
"t": "table_name",
447-
"c": "column_name"
448-
}
449-
}
450-
```
451-
452-
- **Encrypted payload (database side):**
453-
454-
```json
455-
{
456-
"v": 1,
457-
"k": "ct",
458-
"c": "ciphertext value",
459-
"e": {
460-
"t": "table_name",
461-
"c": "column_name"
462-
}
463-
}
464-
```
465-
466-
The format is defined as a [JSON Schema](./cs_encrypted_v1.schema.json).
467-
468-
It should never be necessary to directly interact with the stored `jsonb`.
469-
CipherStash Proxy handles the encoding, and EQL provides the functions.
470-
471-
| Field | Name | Description |
472-
| ----- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
473-
| s | Schema version | JSON Schema version of this json document. |
474-
| v | Version | The configuration version that generated this stored value. |
475-
| k | Kind | The kind of the data (plaintext/pt, ciphertext/ct, encrypting/et). |
476-
| i.t | Table identifier | Name of the table containing encrypted column. |
477-
| i.c | Column identifier | Name of the encrypted column. |
478-
| p | Plaintext | Plaintext value sent by database client. Required if kind is plaintext/pt or encrypting/et. |
479-
| q | For query | Specifies that the plaintext should be encrypted for a specific query operation. If `null`, source encryption and encryption for all indexes will be performed. Valid values are `"match"`, `"ore"`, `"unique"`, `"ste_vec"`, and `"ejson_path"`. |
480-
| c | Ciphertext | Ciphertext value. Encrypted by Proxy. Required if kind is plaintext/pt or encrypting/et. |
481-
| m | Match index | Ciphertext index value. Encrypted by Proxy. |
482-
| o | ORE index | Ciphertext index value. Encrypted by Proxy. |
483-
| u | Unique index | Ciphertext index value. Encrypted by Proxy. |
484-
| sv | STE vector index | Ciphertext index value. Encrypted by Proxy. |
434+
You can read more about the JSONB support in the [JSONB reference guide](docs/reference/JSON.md).
485435

486436
## Frequently Asked Questions
487437

@@ -501,12 +451,23 @@ No, CipherStash Proxy is required to handle the encryption and decryption operat
501451
Data is encrypted using CipherStash's cryptographic schemes and stored in the `cs_encrypted_v1` column as a JSONB payload.
502452
Encryption and decryption are handled by CipherStash Proxy.
503453

504-
## Helper packages
454+
## Helper packages and examples
505455

506456
We've created a few langague specific packages to help you interact with the payloads:
507457

508-
- **JavaScript/TypeScript**: [@cipherstash/eql](https://github.com/cipherstash/encrypt-query-language/tree/main/languages/javascript/packages/eql)
509-
- **Go**: [github.com/cipherstash/goeql](https://github.com/cipherstash/goeql)
458+
459+
| Language | ORM | Example | Package |
460+
| ---------- | ----------- | ----------------------------------------------------------------- | ---------------------------------------------------------------- |
461+
| Go | Xorm | [Go/Xorm examples](./examples/go/xorm/README.md) | [goeql](https://github.com/cipherstash/goeql) |
462+
| Typescript | Drizzle | [Drizzle examples](./examples/javascript/apps/drizzle/README.md) | [cipherstash/eql](./examples/javascript/packages/eql/README.md) |
463+
| Typescript | Prisma | [Drizzle examples](./examples/javascript/apps/prisma/README.md) | [cipherstash/eql](./examples/javascript/packages/eql/README.md) |
464+
| Python | SQL Alchemy | [Python examples](./examples/python/jupyter_notebook/README.md) | |
465+
466+
### Language specific packages
467+
468+
- [Go](https://github.com/cipherstash/goeql)
469+
- [Javascript](https://github.com/cipherstash/encrypt-query-language/tree/main/examples/javascript/packages/eql)
470+
- Python (coming soon)
510471

511472
## Releasing
512473

docs/README.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# EQL Documentation
2+
3+
This directory contains the documentation for the Encrypt Query Language (EQL).
4+
5+
## Concepts
6+
7+
The following concepts are available:
8+
9+
- [Why we built EQL](concepts/WHY.md)
10+
11+
## Reference
12+
13+
The following reference guides are available:
14+
15+
- [EQL index configuration](reference/INDEX.md)
16+
- [JSONB and JSON support](reference/JSON.md)
17+
- [Migrating plaintext data](reference/MIGRATOR.md)
18+
- [EQL payload data format](reference/PAYLOAD.md)
19+
20+
## Tutorials
21+
22+
The following tutorials are available:
23+
24+
- [Getting started](tutorials/GETTINGSTARTED.md)
25+
- [Using CipherStash Proxy](tutorials/PROXY.md)

0 commit comments

Comments
 (0)