Home

Can't Insert Records with TIMESTAMP fields in SQLite

Not sure who creates the dbContext, LINQPad or the provider library, but using LINQPad v8.3.2 and the LINQ 2 DB v5.2.2 provider for SQLite, all TIMESTAMP fields are getting annotated with SkipOnInsert and SkipOnUpdate, causing them to have null timestamps, even though the source object being inserted has a valid timestamp. Snippet of a class shown below. Also, I am using BulkCopy on the context, but I don't think that is the main issue.

Is this a LINQPad bug or a LINQ 2 DB bug?
Thanks,
-Glen


Comments

  • I've created issue for it https://github.com/linq2db/linq2db/issues/4449

    Only workaround I can suggest is to change column type name to something else (e.g. add new column, copy data and delete old one)

  • @Dluk Thanks for the update. I read your issue report, and I had already reached the same conclusion. Thanks for saving me the trouble of creating the bug report. The bug was introduced all the way back in March 14, 2013 in commit eb30773, so I'm surprised that it has not been reported and fixed long before now. I had switched computers, and my old machine (works) was using v4.2.0 and I just installed the latest when building the new machine, v5.2.2.

    I downgraded the driver to v4.2.0, but now ANY LINQ query against any table results in:
    MissingFieldException: Field not found: 'Linq.OptimizeJoins'.

    ... even though I can run SQL queries against the same DB connection and table without issue.
    Any ideas how to clear out the new issue?

  • Solved the issue with:
    MissingFieldException: Field not found: 'Linq.OptimizeJoins'.

    ... the newer version LINQ 2 DB was still referenced in "My Extensions".
    Removing it solved my issue and I'm back in business with v4.2.0. Thanks!

Sign In or Register to comment.