Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-4178

Oracle primary keys should be generated by triggers

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.7
    • Component/s: Database
    • Labels:
      None

      Description

      All the supported databases, except Oracle, support auto-generation of primary keys. Our code must use special SQL requests for Oracle :

      INSERT INTO active_dashboards (id, dashboard_id, user_id, order_index)
          VALUES (select active_dashboards_seq.NEXTVAL from DUAL, ....)
      

      This leads to code duplication but above all to this side-effect :

      Triggers should automatically inject the primary key when it's missing from INSERT requests.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              henryju OLD - Julien HENRY
              Reporter:
              simon.brandhof Simon Brandhof (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: