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.
- PostgreSQL database
- CipherStash Proxy running locally and connected to the database
- Create a PostgreSQL database and a user with read and write permissions.
- 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).
- Run the following command to install the dependencies:
bun install
- Run the following command to insert a new user with an encrypted email:
bun insert --email your-email@example.com
- Run the following command to select all the encrypted emails from the database:
bun select
This project is licensed under the MIT License.