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

MerginMaps / geodiff / 3710958510

pending completion
3710958510

push

github

GitHub
allow python logger to set to None (#192)

3047 of 4066 relevant lines covered (74.94%)

409.27 hits per line

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

91.18
/geodiff/src/driver.cpp
1
/*
2
 GEODIFF - MIT License
3
 Copyright (C) 2020 Martin Dobias
4
*/
5

6
#include <cassert>
7

8
#include "driver.h"
9
#include "sqlitedriver.h"
10
#include "geodiff_config.hpp"
11

12
#ifdef HAVE_POSTGRES
13
#include "postgresdriver.h"
14
#endif
15

16
// define driver names
17
const std::string Driver::SQLITEDRIVERNAME = "sqlite";
18
const std::string Driver::POSTGRESDRIVERNAME = "postgres";
19

20
Driver::Driver( const Context *context )
378✔
21
  : mContext( context )
378✔
22
{
23
  assert( mContext );
378✔
24
}
378✔
25

26
Driver::~Driver() = default;
378✔
27

28
const Context *Driver::context() const
5,416✔
29
{
30
  return mContext;
5,416✔
31
}
32

33
std::vector<std::string> Driver::drivers()
15✔
34
{
35
  std::vector<std::string> names;
15✔
36
  names.push_back( SQLITEDRIVERNAME );
15✔
37
#ifdef HAVE_POSTGRES
38
  names.push_back( POSTGRESDRIVERNAME );
15✔
39
#endif
40
  return names;
15✔
41
}
×
42

43
bool Driver::driverIsRegistered( const std::string &driverName )
3✔
44
{
45
  const std::vector<std::string> drivers = Driver::drivers();
3✔
46
  return std::find( drivers.begin(), drivers.end(), driverName ) != drivers.end();
6✔
47
}
3✔
48

49
std::unique_ptr<Driver> Driver::createDriver( const Context *context, const std::string &driverName )
379✔
50
{
51
  if ( driverName == SQLITEDRIVERNAME )
379✔
52
  {
53
    return std::unique_ptr<Driver>( new SqliteDriver( context ) );
315✔
54
  }
55
#ifdef HAVE_POSTGRES
56
  if ( driverName == POSTGRESDRIVERNAME )
64✔
57
  {
58
    return std::unique_ptr<Driver>( new PostgresDriver( context ) );
63✔
59
  }
60
#endif
61
  return std::unique_ptr<Driver>();
1✔
62
}
63

64
DriverParametersMap Driver::sqliteParameters( const std::string &filenameBase, const std::string &filenameModified )
5✔
65
{
66
  DriverParametersMap conn;
5✔
67
  conn["base"] = filenameBase;
5✔
68
  conn["modified"] = filenameModified;
5✔
69
  return conn;
5✔
70
}
×
71

72
DriverParametersMap Driver::sqliteParametersSingleSource( const std::string &filename )
11✔
73
{
74
  DriverParametersMap conn;
11✔
75
  conn["base"] = filename;
11✔
76
  return conn;
11✔
77
}
×
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