Skip to content

Commit 6ba78f6

Browse files
authored
Merge pull request #133 from cipherstash/update-docs
Update all the docs
2 parents 5a9b162 + 3d4231d commit 6ba78f6

File tree

8 files changed

+1402
-771
lines changed

8 files changed

+1402
-771
lines changed

DEVELOPMENT.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,17 @@ This produces two SQL files in `releases/`:
318318

319319
## Structure
320320

321+
### Adding SQL
322+
323+
When adding new SQL files to the project, follow these guidelines:
324+
325+
- Never drop the configuration table as it may contain customer data and needs to live across EQL versions
326+
- Everything else should have a `DROP IF EXISTS`
327+
- Functions should be `DROP` and `CREATE`, instead of `CREATE OR REPLACE`
328+
- Data types cannot be changed once created, so dropping first is more flexible
329+
- Keep `DROP` and `CREATE` together in the code
330+
- Types need to be dropped last, add to the `666-drop_types.sql`
331+
321332
### Schema
322333

323334
EQL is installed into the `eql_v2` PostgreSQL schema.

README.md

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ Store encrypted data alongside your existing data:
2323
- [Enable encrypted columns](#enable-encrypted-columns)
2424
- [Encrypt configuration](#encrypt-configuration)
2525
- [CipherStash integrations using EQL](#cipherstash-integrations-using-eql)
26-
- [Developing](#developing)
26+
- [Versioning](#versioning)
27+
- [Upgrading](#upgrading)
28+
- [Troubleshooting](#troubleshooting)
29+
- [Contributing](#contributing)
2730

2831
---
2932

@@ -169,7 +172,7 @@ You can find the EQL extension on [dbdev's extension catalog](https://database.d
169172

170173
## Getting started
171174

172-
Once the custom types and functions are installed in your PostgreSQL database, you can start using EQL in your queries.
175+
Once EQL is installed in your PostgreSQL database, you can start using encrypted columns in your tables.
173176

174177
### Enable encrypted columns
175178

@@ -178,12 +181,22 @@ Define encrypted columns using the `eql_v2_encrypted` type, which stores encrypt
178181
**Example:**
179182

180183
```sql
184+
-- Step 1: Create a table with an encrypted column
181185
CREATE TABLE users (
182186
id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
183187
encrypted_email eql_v2_encrypted
184188
);
189+
190+
-- Step 2: Configure the column for encryption/decryption
191+
SELECT eql_v2.add_column('users', 'encrypted_email', 'text');
192+
193+
-- Step 3: (Optional) Add search indexes
194+
SELECT eql_v2.add_search_config('users', 'encrypted_email', 'unique', 'text');
185195
```
186196

197+
> [!NOTE]
198+
> You must use [CipherStash Proxy](https://github.com/cipherstash/proxy) or [Protect.js](https://github.com/cipherstash/protectjs) to encrypt and decrypt data. EQL provides the database functions and types, while these tools handle the actual cryptographic operations.
199+
187200
## Encrypt configuration
188201

189202
In order to enable searchable encryption, you will need to configure your CipherStash integration appropriately.
@@ -232,6 +245,28 @@ To upgrade to the latest version of EQL, you can simply run the install script a
232245

233246
Follow the instructions in the [dbdev documentation](https://database.dev/cipherstash/eql) to upgrade the extension to your desired version.
234247

235-
## Developing
248+
## Troubleshooting
249+
250+
### Common Errors
251+
252+
**Error: "Some pending columns do not have an encrypted target"**
253+
- **Cause**: Trying to configure a column that doesn't exist as `eql_v2_encrypted` type
254+
- **Solution**: First create the column: `ALTER TABLE table_name ADD COLUMN column_name eql_v2_encrypted;`
255+
256+
**Error: "Config exists for column: table_name column_name"**
257+
- **Cause**: Attempting to add a column configuration that already exists
258+
- **Solution**: Use `eql_v2.add_search_config()` to add indexes, or `eql_v2.remove_column()` first to reconfigure
259+
260+
**Error: "No configuration exists for column: table_name column_name"**
261+
- **Cause**: Trying to add search configuration before configuring the column
262+
- **Solution**: Run `eql_v2.add_column()` first, then add search indexes
263+
264+
### Getting Help
265+
266+
- Check the [full documentation](./docs/README.md)
267+
- Review [CipherStash Proxy configuration guide](./docs/tutorials/proxy-configuration.md)
268+
- Report issues at [https://github.com/cipherstash/encrypt-query-language/issues](https://github.com/cipherstash/encrypt-query-language/issues)
269+
270+
## Contributing
236271

237-
See the [development guide](./DEVELOPMENT.md).
272+
See the [development guide](./DEVELOPMENT.md) for information on developing and extending EQL.

docs/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ This directory contains the documentation for the Encrypt Query Language (EQL).
88

99
## Reference
1010

11-
- [EQL index configuration for CipherStash Proxy](reference/index-configuration.md)
11+
- [EQL Functions Reference](reference/eql-functions.md) - Complete API reference for all EQL functions
12+
- [Database Indexes for Encrypted Columns](reference/database-indexes.md) - PostgreSQL B-tree index creation and usage
13+
- [EQL index configuration for CipherStash Proxy](reference/index-config.md)
1214
- [EQL with JSON and JSONB](reference/json-support.md)
13-
- [EQL payload data format](reference/eql-payload.md)
15+
- [EQL payload data format](reference/PAYLOAD.md)
1416

1517
## Tutorials
1618

0 commit comments

Comments
 (0)