How to retrieve database credentials from drizzle.config.ts

I'm attempting to retrieve Neon database credentials dynamically from drizzle.config.ts , instead of saving them in a .env, by running drizzle-kit push. The issue, both methods I tried rely on top-level await and throw Top-level await is currently not supported with the "cjs" output format exception.

  1. @aws-sdk/client-ssm example:
    ```
    const { SSMClient, GetParameterCommand } = require("@aws-sdk/client-ssm");
// Create an SSM client
const ssmClient = new SSMClient();

// Define the parameter name
const parameterName = "your-parameter-name";

// Create a command to get the parameter
const command = new GetParameterCommand({ Name: parameterName, WithDecryption: true });
`` OR 2. SST Secrets https://docs.sst.dev/config#top-level-await Is there a way to accomplish this from within drizzle.config.ts? I'm using "drizzle-kit": "^0.20.1" and "drizzle-orm": "^0.29.0"`
Working with environment variables and secrets in SST.
Was this page helpful?