• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

HicServices / RDMP / 23183960924

17 Mar 2026 07:51AM UTC coverage: 57.138% (+0.02%) from 57.121%
23183960924

Pull #2326

github

JFriel
tidy up
Pull Request #2326: Bugfix/fix merge issue

11549 of 21743 branches covered (53.12%)

Branch coverage included in aggregate %.

19 of 27 new or added lines in 7 files covered. (70.37%)

3 existing lines in 3 files now uncovered.

32673 of 55652 relevant lines covered (58.71%)

18185.95 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

62.5
/Rdmp.Core/DataLoad/Triggers/Implementations/TriggerImplementerFactory.cs
1
// Copyright (c) The University of Dundee 2018-2019
2
// This file is part of the Research Data Management Platform (RDMP).
3
// RDMP is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
4
// RDMP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
5
// You should have received a copy of the GNU General Public License along with RDMP. If not, see <https://www.gnu.org/licenses/>.
6

7
using System;
8
using FAnsi;
9
using FAnsi.Discovery;
10

11
namespace Rdmp.Core.DataLoad.Triggers.Implementations;
12

13
/// <summary>
14
/// Handles the creation of the appropriate <see cref="ITriggerImplementer"/> for any given <see cref="DatabaseType"/>
15
/// </summary>
16
public class TriggerImplementerFactory
17
{
18
    private readonly DatabaseType _databaseType;
19

20
    public TriggerImplementerFactory(DatabaseType databaseType)
264✔
21
    {
22
        _databaseType = databaseType;
264✔
23
    }
264✔
24

25
    public ITriggerImplementer Create(DiscoveredTable table, bool createDataLoadRunIDAlso = true,bool dontAddDataLoadrunID = false)
26
    {
27
        return _databaseType switch
276!
28
        {
276✔
29
            DatabaseType.MicrosoftSQLServer => new MicrosoftSQLTriggerImplementer(table, createDataLoadRunIDAlso, dontAddDataLoadrunID),
186✔
30
            DatabaseType.MySql => new MySqlTriggerImplementer(table, createDataLoadRunIDAlso, dontAddDataLoadrunID),
90✔
NEW
31
            DatabaseType.Oracle => new OracleTriggerImplementer(table, createDataLoadRunIDAlso, dontAddDataLoadrunID),
×
NEW
32
            DatabaseType.PostgreSql => new PostgreSqlTriggerImplementer(table, createDataLoadRunIDAlso, dontAddDataLoadrunID),
×
UNCOV
33
            _ => throw new ArgumentOutOfRangeException(nameof(_databaseType))
×
34
        };
276✔
35
    }
36
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc