3

In MySql database, I have columns "created" and "updated" which are marked with CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP respectively. I never want to manually update these fields, but I do want to read them. SqlKata has Ignore property, but that completely ignores it (surprise!). Is there something like IgnoreOnInsert or similar workaround?

Now I go around this by having a sub-object that does not have these 2 properties, but this is not nice.

gajo357
  • 958
  • 12
  • 22
  • 1
    The `Ignore` attribute does not ignore them while reading. – amd Nov 30 '20 at 09:57
  • @amd Thank you very much. I completely misunderstood the [Ignore] attribute. Could you post your comment as an answer so I can accept it? – gajo357 Dec 01 '20 at 10:19

1 Answers1

4

The Ignore attribute only affect Insert/Update operations, select statements are not affected.

amd
  • 20,637
  • 6
  • 49
  • 67
  • is there an Ignore only for updates? We create ids code-wise and insert the id, but would like to ignore the id by an update. – Niels Lucas Jun 21 '23 at 13:45