All queries are executed through a transaction object, event when being executed through singe-query interface, so here only executing queries with transaction will be covered. Single-query interface is basically the same except for additional options.
uPg provides means to execute text queries only. There is no query generation, but can be used by other tools to execute SQL queries.
All queries are parsed and prepared during the first invocation and are executed as prepared statements afterwards.
Any query execution can throw an exception. Please see uPg: Postgres errors for more information on possible errors.
Executing a query without any parameters is rather straightforward.
The cluster also provides interface for single queries
You may store SQL queries in separate .sql
files and access them via sql_queries.hpp include header. See External SQL/YQL files for more information.
uPg supports SQL dollar notation for parameter placeholders. The statement is prepared at first execution and then only arguments for a query is sent to the server.
A parameter can be of any type that is supported by the driver. See uPg: Supported data types for more information.
.sql
file and generate a header file with Query from it. See External SQL/YQL files for more information.