# ConnectionProvider.hpp

This File On Github
Ask A Question

API: latest
module: oatpp-postgresql
#include "oatpp-postgresql/ConnectionProvider.hpp"

# ConnectionProvider

Connection provider.

namespace oatpp { namespace postgresql { 
  class ConnectionProvider : public provider::Provider<Connection> {}
}}

# Methods

Return Type Name Summary
[none] ConnectionProvider Constructor.
std::shared_ptr<Connection> get Get Connection.
async::CoroutineStarterForResult<const std::shared_ptr<Connection>&> getAsync Get Connection in Async manner.
void invalidate Invalidate Connection that was previously created by this provider.
void stop Stop provider and free associated resources.

# ConnectionProvider::ConnectionProvider

Constructor.

  • @param connectionString

ConnectionProvider(const oatpp::String& connectionString)

# ConnectionProvider::get

Get Connection.

  • @return - resource.

std::shared_ptr<Connection> get() override

# ConnectionProvider::getAsync

Get Connection in Async manner.

  • @return - oatpp::async::CoroutineStarterForResult of Connection.

async::CoroutineStarterForResult<const std::shared_ptr<Connection>&> getAsync() override

# ConnectionProvider::invalidate

Invalidate Connection that was previously created by this provider.

  • @param resource

void invalidate(const std::shared_ptr<Connection>& resource) override

# ConnectionProvider::stop

Stop provider and free associated resources.

void stop() override

# ConnectionPool

Namespace: oatpp::postgresql

Connection pool.
- oatpp::postgresql::Connection. - oatpp::postgresql::ConnectionAcquisitionProxy.

typedef oatpp::provider::Pool<
  provider::Provider<Connection>,
  Connection,
  ConnectionAcquisitionProxy
> ConnectionPool