| | |
| | | | real | float | |
| | | | DOUBLE | double | |
| | | | text | const char*<br>std::string | |
| | | | bytea | qtl::const_blob_data<br>std::vector<uint8_t> | |
| | | | oid | qtl::postgres::large_object | |
| | | | date | qtl::postgres::date | |
| | | | timestamp | qtl::postgres::timestamp | |
| | | | interval | qtl::postgres::interval | |
| | |
| | | | real | float | |
| | | | DOUBLE | double | |
| | | | text | char[N]<br>std::array<char, N><br>std::string | |
| | | | bytea | qtl::const_blob_data<br>qtl::blob_data<br>std::vector<uint8_t> | |
| | | | oid | qtl::postgres::large_object | |
| | | | date | qtl::postgres::date | |
| | | | timestamp | qtl::postgres::timestamp | |
| | | | interval | qtl::postgres::interval | |
| | |
| | | |
| | | Third-party libraries for compiling test cases need to be downloaded separately. In addition to database-related libraries, test cases use a test framework[CppTest](https://sourceforge.net/projects/cpptest/ "CppTest")。 |
| | | |
| | | The MySQL database used in the test case is as follows: |
| | | The database used in the test case is as follows: |
| | | |
| | | ### MySQL |
| | | ```SQL |
| | | CREATE TABLE test ( |
| | | ID int NOT NULL AUTO_INCREMENT, |
| | |
| | | PRIMARY KEY (ID) |
| | | ); |
| | | ``` |
| | | |
| | | ### PostgreSQL |
| | | ```SQL |
| | | DROP TABLE IF EXISTS test; |
| | | CREATE TABLE test ( |
| | | id int4 NOT NULL GENERATED BY DEFAULT AS IDENTITY ( |
| | | INCREMENT 1 |
| | | MINVALUE 1 |
| | | MAXVALUE 2147483647 |
| | | START 1 |
| | | ), |
| | | name varchar(255) COLLATE default, |
| | | createtime timestamp(6) |
| | | ) |
| | | ; |
| | | |
| | | ALTER TABLE test ADD CONSTRAINT test_pkey PRIMARY KEY ("id"); |
| | | |
| | | DROP TABLE IF EXISTS test_blob; |
| | | CREATE TABLE test_blob ( |
| | | id int4 NOT NULL GENERATED BY DEFAULT AS IDENTITY ( |
| | | INCREMENT 1 |
| | | MINVALUE 1 |
| | | MAXVALUE 2147483647 |
| | | START 1 |
| | | ), |
| | | filename varchar(255) COLLATE default NOT NULL, |
| | | md5 bytea, |
| | | content oid |
| | | ) |
| | | ; |
| | | |
| | | ALTER TABLE test_blob ADD CONSTRAINT test_blob_pkey PRIMARY KEY ("id"); |
| | | ``` |