<p>Uses a nice class with RAII and is much cleaner.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/osm2pgsql/pull/998'>https://github.com/openstreetmap/osm2pgsql/pull/998</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>make pg connection a class</li>
  <li>Formatting</li>
  <li>Various cleanups</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/998/files#diff-0">src/db-copy.cpp</a>
    (49)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/998/files#diff-1">src/db-copy.hpp</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/998/files#diff-2">src/middle-pgsql.cpp</a>
    (85)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/998/files#diff-3">src/middle-pgsql.hpp</a>
    (8)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/998/files#diff-4">src/output-gazetteer.cpp</a>
    (48)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/998/files#diff-5">src/output-gazetteer.hpp</a>
    (8)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/998/files#diff-6">src/pgsql.cpp</a>
    (174)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/998/files#diff-7">src/pgsql.hpp</a>
    (90)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/998/files#diff-8">src/table.cpp</a>
    (251)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/osm2pgsql/pull/998/files#diff-9">src/table.hpp</a>
    (5)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/osm2pgsql/pull/998.patch'>https://github.com/openstreetmap/osm2pgsql/pull/998.patch</a></li>
  <li><a href='https://github.com/openstreetmap/osm2pgsql/pull/998.diff'>https://github.com/openstreetmap/osm2pgsql/pull/998.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/osm2pgsql/pull/998?email_source=notifications&email_token=AA6353UZZMUPGOWCDURXLPLQVJ4HNA5CNFSM4JQ67Y5KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H3T7Z7Q">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353XCHFL7WAGZVADCUJTQVJ4HNANCNFSM4JQ67Y5A">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AA6353UU34LYPDLX6EALYNLQVJ4HNA5CNFSM4JQ67Y5KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H3T7Z7Q.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/osm2pgsql/pull/998?email_source=notifications\u0026email_token=AA6353UZZMUPGOWCDURXLPLQVJ4HNA5CNFSM4JQ67Y5KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H3T7Z7Q",
"url": "https://github.com/openstreetmap/osm2pgsql/pull/998?email_source=notifications\u0026email_token=AA6353UZZMUPGOWCDURXLPLQVJ4HNA5CNFSM4JQ67Y5KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H3T7Z7Q",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>