Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-6996

Smarter handling of id fields in SQL values

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • sql
    • None

    Description

      Consider such case:

      User wants to have a composite value (many value fields in QueryEntity) with one field associated with value's id (most likely matching cache key too).

      Currently in order to insert such an object we will have to do something like
      INSERT INTO Person(_key, id, name) values(1, 1, 'John')

      And there's no way to avoid such a redundant repeat of the same value.

      Suggested approach: I believe that we should specifically handle the case when user specifies keyFieldName in configuration and specified field is field of the value.

      In such case, we could just do INSERT INTO Person(id, name) values(1, 'John') and derive _key value from id column. (And vice versa.)

      At a glance, this also will require following tweaks:

      • forbid performing SQL UPDATE on such column (id in above example);
      • on an INSERT, check that _key and id values are the same, if both specified.

      Attachments

        Activity

          People

            Unassigned Unassigned
            al.psc Alexander Paschenko
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: