This is a example using the drizzle-orm.
- PostgreSQL database
- CipherStash credentials and account
- Create a PostgreSQL database and a user with read and write permissions.
- Create a
.env
file in the root directory of the project with the following content:
DATABASE_URL="postgresql://[username]:[password]@[host]:5432/[database]"
CS_CLIENT_ID=[client-id]
CS_CLIENT_KEY=[client-key]
CS_WORKSPACE_ID=[workspace-id]
CS_CLIENT_ACCESS_KEY=[access-key]
- Run the following command to install the dependencies:
npm install
- Run the following command to insert a new user with an encrypted email:
npx tsx src/insert.ts --email [email protected]
- Run the following command to select all the encrypted emails from the database:
npx tsx src/select.ts
This project is licensed under the MIT License.