AscendingCreations / AxumSession

Axum Session Management Libraries that use Sqlx
MIT License
136 stars 28 forks source link

How it works with Amazon Aurora #85

Closed kmonkey closed 4 weeks ago

kmonkey commented 1 month ago

I am using axum-session for session management. I have prepared a database for sessions in PostgreSQL on Amazon Aurora, but because Amazon Aurora does not allow DDL statements, an error occurs when initializing SessionPgSessionStore. Is it impossible to run axum-session on Amazon Aurora? Is this even something to ask sqlx?

https://github.com/AscendingCreations/AxumSession/blob/main/databases/sqlx/src/postgres.rs#L26

genusistimelord commented 1 month ago

Based on the https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.diag-table-ind-bloat.html

It does support DDL statements. You might just need to give the right amount of permissions to the account Accessing the Database to be able to Create/Alter tables, Delete/Insert/Modify Rows. If you are worried about Security, I could suggest creating a new Database that only deals with session data.

kmonkey commented 4 weeks ago

Sorry. I was not clear enough. I meant Amazon Aurora global databases because it does not support DDL.

https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database-write-forwarding-apg.html#aurora-global-database-write-forwarding-compatibility-apg

As explained on the above page, DDL is not supported with write forwarding. This constraint causes the create table statement to fail.

For now, I'll use a custom pool that implements DatabasePool trait.

Thanks