// file      : odb/pgsql/query-dynamic.txx
// license   : GNU GPL v2; see accompanying LICENSE file

namespace odb
{
  namespace pgsql
  {
    template <typename T, database_type_id ID>
    std::shared_ptr<query_param>
    query_param_factory_impl (const void* val, bool by_ref)
    {
      const T& v (*static_cast<const T*> (val));

      return std::shared_ptr<query_param> (
        by_ref
        ? std::make_shared<query_param_impl<T, ID>> (ref_bind<T> (v))
        : std::make_shared<query_param_impl<T, ID>> (val_bind<T> (v)));
    }
  }
}
