kleydon / prisma-session-store

Express session store for Prisma
MIT License
116 stars 18 forks source link

Update README.md guide #118

Closed aathikahamed closed 10 months ago

aathikahamed commented 10 months ago

I was getting this error because of using the settings from the readme file.

PrismaClientKnownRequestError:
Invalid `this.prisma[this.sessionModelName].create()` invocation in
D:\Coding Files\admin-server\node_modules\@quixo3\prisma-session-store\dist\lib\prisma-session-store.js:543:85

  540 case 4:
  541     _a.sent();
  542     return [3 /*break*/, 7];
→ 543 case 5: return [4 /*yield*/, this.prisma[this.sessionModelName].create(
The provided value for the column is too long for the column's type. Column: for
    at Rn.handleRequestError (D:\Coding Files\admin-server\node_modules\@prisma\client\runtime\library.js:174:7325)
    at Rn.handleAndLogRequestError (D:\Coding Files\admin-server\node_modules\@prisma\client\runtime\library.js:174:6754)
    at Rn.request (D:\Coding Files\admin-server\node_modules\@prisma\client\runtime\library.js:174:6344)

After doing some research I had to change update this settings on my prisma schema.

Updating this hoping it would be beneficial for someone.

- data      String
+ data      String   @db.MediumText
kleydon commented 10 months ago

@aathikahamed - Thanks for the contribution!

Any chance you can specify which database you found this fix useful for? (Does it apply to one database in particular, or does it apply across all of the databases that Prisma supports)?

Thanks again,

-K

aathikahamed commented 10 months ago

Not sure on whether this applies to all the databases.

In my case I'm using the PlanetScale MySQL database.

Also, this is where I found for the fix.

kleydon commented 10 months ago

Got it - thanks for the context.