Skip to content

Files

Latest commit

f24e403 · Nov 8, 2024

History

History
41 lines (26 loc) · 1.13 KB

File metadata and controls

41 lines (26 loc) · 1.13 KB

drizzle-eql

This is a example using the drizzle-orm library to insert and select encrypted data from a PostgreSQL database using the EQL and CipherStash Proxy.

Prerequisites

  • PostgreSQL database
  • CipherStash Proxy running locally and connected to the database

Setup

  1. Create a PostgreSQL database and a user with read and write permissions.
  2. Create a .env.local file in the root directory of the project with the following content:
DATABASE_URL="postgresql://[username]:[password]@localhost:6432/[database]"

Note: This assumes you are running CipherStash Proxy locally on your machine on port 6432 (default).

  1. Run the following command to install the dependencies:
bun install
  1. Run the following command to insert a new user with an encrypted email:
bun insert --email your-email@example.com
  1. Run the following command to select all the encrypted emails from the database:
bun select

License

This project is licensed under the MIT License.