First Commit
Some checks failed
/ build_macos (push) Has been cancelled
/ build_windows (push) Has been cancelled
/ build_ubuntu (push) Has been cancelled

This commit is contained in:
2025-11-19 16:23:45 +07:00
commit dbdc5bcc4a
1791 changed files with 489451 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
#include <pqxx/internal/callgate.hxx>
namespace pqxx
{
class connection;
class errorhandler;
} // namespace pqxx
namespace pqxx::internal::gate
{
class PQXX_PRIVATE connection_errorhandler : callgate<connection>
{
friend class pqxx::errorhandler;
connection_errorhandler(reference x) : super(x) {}
void register_errorhandler(errorhandler *h)
{
home().register_errorhandler(h);
}
void unregister_errorhandler(errorhandler *h)
{
home().unregister_errorhandler(h);
}
};
} // namespace pqxx::internal::gate

View File

@@ -0,0 +1,35 @@
#include <string>
#include <pqxx/internal/callgate.hxx>
#include <pqxx/internal/libpq-forward.hxx>
namespace pqxx
{
class blob;
class largeobject;
} // namespace pqxx
namespace pqxx::internal::gate
{
class PQXX_PRIVATE connection_largeobject : callgate<connection>
{
friend class pqxx::blob;
friend class pqxx::largeobject;
connection_largeobject(reference x) : super(x) {}
pq::PGconn *raw_connection() const { return home().raw_connection(); }
};
class PQXX_PRIVATE const_connection_largeobject : callgate<connection const>
{
friend class pqxx::blob;
friend class pqxx::largeobject;
const_connection_largeobject(reference x) : super(x) {}
std::string error_message() const { return home().err_msg(); }
};
} // namespace pqxx::internal::gate

View File

@@ -0,0 +1,29 @@
#include <pqxx/internal/callgate.hxx>
#include "pqxx/connection.hxx"
namespace pqxx
{
class notification_receiver;
}
namespace pqxx::internal::gate
{
class PQXX_PRIVATE connection_notification_receiver : callgate<connection>
{
friend class pqxx::notification_receiver;
connection_notification_receiver(reference x) : super(x) {}
void add_receiver(notification_receiver *receiver)
{
home().add_receiver(receiver);
}
void remove_receiver(notification_receiver *receiver) noexcept
{
home().remove_receiver(receiver);
}
};
} // namespace pqxx::internal::gate

View File

@@ -0,0 +1,23 @@
#include "pqxx/internal/libpq-forward.hxx"
#include <pqxx/internal/callgate.hxx>
#include "pqxx/pipeline.hxx"
namespace pqxx::internal::gate
{
class PQXX_PRIVATE connection_pipeline : callgate<connection>
{
friend class pqxx::pipeline;
connection_pipeline(reference x) : super(x) {}
void start_exec(char const query[]) { home().start_exec(query); }
pqxx::internal::pq::PGresult *get_result() { return home().get_result(); }
void cancel_query() { home().cancel_query(); }
bool consume_input() noexcept { return home().consume_input(); }
bool is_busy() const noexcept { return home().is_busy(); }
int encoding_id() { return home().encoding_id(); }
};
} // namespace pqxx::internal::gate

View File

@@ -0,0 +1,19 @@
#include <pqxx/internal/callgate.hxx>
namespace pqxx::internal
{
class sql_cursor;
}
namespace pqxx::internal::gate
{
class PQXX_PRIVATE connection_sql_cursor : callgate<connection>
{
friend class pqxx::internal::sql_cursor;
connection_sql_cursor(reference x) : super(x) {}
result exec(char const query[]) { return home().exec(query); }
};
} // namespace pqxx::internal::gate

View File

@@ -0,0 +1,15 @@
#include <pqxx/internal/callgate.hxx>
#include "pqxx/connection.hxx"
namespace pqxx::internal::gate
{
class PQXX_PRIVATE connection_stream_from : callgate<connection>
{
friend class pqxx::stream_from;
connection_stream_from(reference x) : super{x} {}
auto read_copy_line() { return home().read_copy_line(); }
};
} // namespace pqxx::internal::gate

View File

@@ -0,0 +1,17 @@
#include <pqxx/internal/callgate.hxx>
#include "pqxx/stream_to.hxx"
namespace pqxx::internal::gate
{
class PQXX_PRIVATE connection_stream_to : callgate<connection>
{
friend class pqxx::stream_to;
connection_stream_to(reference x) : super(x) {}
void write_copy_line(std::string_view line) { home().write_copy_line(line); }
void end_copy_write() { home().end_copy_write(); }
};
} // namespace pqxx::internal::gate

View File

@@ -0,0 +1,44 @@
#include <pqxx/internal/callgate.hxx>
namespace pqxx
{
class connection;
}
namespace pqxx::internal::gate
{
class PQXX_PRIVATE connection_transaction : callgate<connection>
{
friend class pqxx::transaction_base;
connection_transaction(reference x) : super(x) {}
template<typename STRING> result exec(STRING query, std::string_view desc)
{
return home().exec(query, desc);
}
void register_transaction(transaction_base *t)
{
home().register_transaction(t);
}
void unregister_transaction(transaction_base *t) noexcept
{
home().unregister_transaction(t);
}
auto read_copy_line() { return home().read_copy_line(); }
void write_copy_line(std::string_view line) { home().write_copy_line(line); }
void end_copy_write() { home().end_copy_write(); }
result exec_prepared(zview statement, internal::c_params const &args)
{
return home().exec_prepared(statement, args);
}
result exec_params(zview query, internal::c_params const &args)
{
return home().exec_params(query, args);
}
};
} // namespace pqxx::internal::gate

View File

@@ -0,0 +1,13 @@
#include <pqxx/internal/callgate.hxx>
namespace pqxx::internal::gate
{
class PQXX_PRIVATE errorhandler_connection : callgate<errorhandler>
{
friend class pqxx::connection;
errorhandler_connection(reference x) : super(x) {}
void unregister() noexcept { home().unregister(); }
};
} // namespace pqxx::internal::gate

View File

@@ -0,0 +1,24 @@
#include <pqxx/internal/callgate.hxx>
namespace pqxx::internal::gate
{
class PQXX_PRIVATE icursor_iterator_icursorstream : callgate<icursor_iterator>
{
friend class pqxx::icursorstream;
icursor_iterator_icursorstream(reference x) : super(x) {}
icursor_iterator::difference_type pos() const noexcept
{
return home().pos();
}
icursor_iterator *get_prev() { return home().m_prev; }
void set_prev(icursor_iterator *i) { home().m_prev = i; }
icursor_iterator *get_next() { return home().m_next; }
void set_next(icursor_iterator *i) { home().m_next = i; }
void fill(result const &r) { home().fill(r); }
};
} // namespace pqxx::internal::gate

View File

@@ -0,0 +1,32 @@
#include <pqxx/internal/callgate.hxx>
namespace pqxx::internal::gate
{
class PQXX_PRIVATE icursorstream_icursor_iterator : callgate<icursorstream>
{
friend class pqxx::icursor_iterator;
icursorstream_icursor_iterator(reference x) : super(x) {}
void insert_iterator(icursor_iterator *i) noexcept
{
home().insert_iterator(i);
}
void remove_iterator(icursor_iterator *i) const noexcept
{
home().remove_iterator(i);
}
icursorstream::size_type forward() { return home().forward(); }
icursorstream::size_type forward(icursorstream::size_type n)
{
return home().forward(n);
}
void service_iterators(icursorstream::difference_type p)
{
home().service_iterators(p);
}
};
} // namespace pqxx::internal::gate

View File

@@ -0,0 +1,14 @@
#include <pqxx/internal/callgate.hxx>
namespace pqxx::internal::gate
{
class PQXX_PRIVATE result_connection : callgate<result const>
{
friend class pqxx::connection;
result_connection(reference x) : super(x) {}
operator bool() const { return bool(home()); }
bool operator!() const { return not home(); }
};
} // namespace pqxx::internal::gate

View File

@@ -0,0 +1,24 @@
#include <pqxx/internal/callgate.hxx>
namespace pqxx::internal::gate
{
class PQXX_PRIVATE result_creation : callgate<result const>
{
friend class pqxx::connection;
friend class pqxx::pipeline;
result_creation(reference x) : super(x) {}
static result create(
internal::pq::PGresult *rhs, std::shared_ptr<std::string> const &query,
encoding_group enc)
{
return result(rhs, query, enc);
}
void check_status(std::string_view desc = ""sv) const
{
return home().check_status(desc);
}
};
} // namespace pqxx::internal::gate

View File

@@ -0,0 +1,16 @@
#include <pqxx/internal/callgate.hxx>
namespace pqxx::internal::gate
{
class PQXX_PRIVATE result_pipeline : callgate<result const>
{
friend class pqxx::pipeline;
result_pipeline(reference x) : super(x) {}
std::shared_ptr<std::string const> query_ptr() const
{
return home().query_ptr();
}
};
} // namespace pqxx::internal::gate

View File

@@ -0,0 +1,13 @@
#include <pqxx/internal/callgate.hxx>
namespace pqxx::internal::gate
{
class PQXX_PRIVATE result_sql_cursor : callgate<result const>
{
friend class pqxx::internal::sql_cursor;
result_sql_cursor(reference x) : super(x) {}
char const *cmd_status() const noexcept { return home().cmd_status(); }
};
} // namespace pqxx::internal::gate

View File

@@ -0,0 +1,10 @@
#include <pqxx/internal/callgate.hxx>
namespace pqxx::internal::gate
{
class PQXX_PRIVATE transaction_sql_cursor : callgate<transaction_base>
{
friend class pqxx::internal::sql_cursor;
transaction_sql_cursor(reference x) : super(x) {}
};
} // namespace pqxx::internal::gate

View File

@@ -0,0 +1,30 @@
#include <pqxx/internal/callgate.hxx>
#include "pqxx/transaction_base.hxx"
namespace pqxx::internal::gate
{
class PQXX_PRIVATE transaction_transaction_focus : callgate<transaction_base>
{
friend class pqxx::transaction_focus;
transaction_transaction_focus(reference x) : super(x) {}
void register_focus(transaction_focus *focus)
{
home().register_focus(focus);
}
void unregister_focus(transaction_focus *focus) noexcept
{
home().unregister_focus(focus);
}
void register_pending_error(zview error)
{
home().register_pending_error(error);
}
void register_pending_error(std::string &&error)
{
home().register_pending_error(std::move(error));
}
};
} // namespace pqxx::internal::gate