From a2b2faa6019572388248617d0ac740bde95feb74 Mon Sep 17 00:00:00 2001
From: znone <glyc@sina.com.cn>
Date: Fri, 26 Feb 2021 13:44:08 +0000
Subject: [PATCH] PostgreSQL: support binary data PostgreSQl: add database pool
---
README.md | 42 +++++++++++++++++++++++++++++++++++++++++-
1 files changed, 41 insertions(+), 1 deletions(-)
diff --git a/README.md b/README.md
index af77074..b235fd1 100644
--- a/README.md
+++ b/README.md
@@ -413,6 +413,8 @@
| 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 |
@@ -428,6 +430,8 @@
| 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 |
@@ -448,7 +452,9 @@
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,
@@ -465,3 +471,37 @@
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");
+```
--
Gitblit v1.9.3