Open Closed

Sqlite, nvarchar(max), Unit Testing #7130


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)
  • 0
    ismcagdas created

    Hi,

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

    Thanks,

  • 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.

  • 0
    ismcagdas created

    Thanks @digitalcontrol for your feedback.