chatHistory
for the serverless PostgreSQL-compatible Amazon Aurora DSQL Database.
This is very similar to the PostgreSQL integration with a few differences to make it compatible with DSQL:
id
column in PostgreSQL is SERIAL auto-incrementent, and DSQL is UUID using the database function gen_random_uuid
.created_at
column is created to track the order and history of the messages.message
column in PostgreSQL is JSONB, and DSQL is TEXT with Javascript parsing handlingpool
parameter or pass a pool config via the poolConfig
parameter. See pg-node docs on pools
for more information. A provided pool takes precedence, thus if both a pool instance and a pool config are passed, only the pool will be used.
For options on how to do the authentication and authorization for DSQL please check https://docs.aws.amazon.com/aurora-dsql/latest/userguide/authentication-authorization.html.
The following example uses the AWS-SDK to generate an authentication token that is passed to the pool configuration: