pg_async
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Datatype conversions

PostrgreSQL to C++ datatype conversions

Numeric types

PostgreSQL documentation

PostgreSQL C++
smallint tip::db::pg::smallint
integer tip::db::pg::integer
bigint tip::db::pg::bigint
decimal
Todo:

decide MPFR or GMP - ? numeric |

decide MPFR or GMP - ? real | float double precision | double smallserial | tip::db::pg::smallint serial | tip::db::pg::integer bigserial | tip::db::pg::bigint

Character types

PostgreSQL documentation

PostgreSQL C++
varchar(n) std::string
character(n) std::string
text std::string

Monetary type

PostgreSQL documentation

PostgreSQL C++
money
Todo:
decide MPFR or GMP - ?

Binary type

PostgreSQL documentation

PostgreSQL C++
bytea tip::db::pg::bytea

Datetime type

PostgreSQL documentation PostgreSQL date/time support Boost.DateTime library PostgreSQL | C++ ----------------— | ----------------— timestamp | timestamptz | date | time | time with tz | interval |

Boolean type

PostgreSQL documentation

PostgreSQL C++
boolean bool

Enumerated types

PostgreSQL documentation

Geometric types

PostgreSQL documentation

Network address types

PostgreSQL documentation

PostgreSQL | C++ ----------------— | ----------------— cidr | inet | boost::asio::ip::address macaddr |

Bit String types

PostgreSQL documentation

PostgreSQL C++
bit(n) std::bitset<n>
bit varying(n) std::bitset<n>
Todo:
create a signature structure

Text search types

PostgreSQL documentation

UUID type

PostgreSQL documentation

PostgreSQL C++
uuid boost::uuid

XML type

PostgreSQL documentation

PostgreSQL C++
xml std::string

JSON types

PostgreSQL documentation

PostgreSQL C++
json std::string

Arrays

PostgreSQL documentation

PostgreSQL C++
type array(n) std::vector< type mapping >

Composite types

PostgreSQL documentation

Range types

PostgreSQL documentation PostgreSQL | C++ ----------------— | ----------------— int4range | int8range | numrange | tsrange | tstzrange | daterange |