Base solution for your next web application
Open Closed

Sqlite, nvarchar(max), Unit Testing #7130


User avatar
0
digitalcontrol created

My unit tests fails because I have nvarchar(max) in models and I am getting following error: Message: Microsoft.Data.Sqlite.SqliteException : SQLite Error 1: 'near "MAX": syntax error'.

So, SQLLite do not support nvarchar(max), which solution you prefer in this case?


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    This might work https://github.com/aspnet/EntityFrameworkCore/issues/7030#issuecomment-261313340. Could you try that and let us know the result ?

    Thanks,

  • User Avatar
    0
    digitalcontrol created

    Hi,

    Actually, this was not a solution but I found what was my problem. I was using data annotation in my models e.g. [Column(TypeName = "NVARCHAR(MAX)")] but this was unnecessary since EF will set it to MAX by default. So this cause problem with SQLite.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks @digitalcontrol for your feedback.