Remix App Template - PrismaSessionStorage tableName doesn't work

Just wanted to mention that setting a tableName in the constructor of PrismaSessionStorage does not work to change the table name where session data is stored. Trying this way only produces an error of “PrismaClient does not have a ${this.tableName} table”.

The way I got this to work was to use “@@map” markup in the Session model defined in the schema.prisma file (after regenerating the model data).

Hope this saves someone else some time!

1 Like

Hi there :wave:

Thanks for flagging this. And I am glad you are were to get this to work. The team will look into documenting this better.

In addition to mapping the name of the model to the database table using the @@map annotation, I found that I needed to match the tableName parameter to the name of the Prisma model, rather than the name of the database. Perhaps the tableName parameter should be renamed to modelName to more clearly describe how it works?