Title: pgsql-swoole driver can not prompt errors · Issue #9 · hyperf/database-pgsql · GitHub
Open Graph Title: pgsql-swoole driver can not prompt errors · Issue #9 · hyperf/database-pgsql
X Title: pgsql-swoole driver can not prompt errors · Issue #9 · hyperf/database-pgsql
Description: app/Controller/TestController.php #[RequestMapping(path: "create", methods: "get")] public function create(ResponseInterface $response) { $s = \App\Model\Session::create([ 'id' => '131', 'store_id' => 111, 'uuid' => 'abc', 'visitor_id' =...
Open Graph Description: app/Controller/TestController.php #[RequestMapping(path: "create", methods: "get")] public function create(ResponseInterface $response) { $s = \App\Model\Session::create([ 'id' => '131', 'store_id'...
X Description: app/Controller/TestController.php #[RequestMapping(path: "create", methods: "get")] public function create(ResponseInterface $response) { $s = \App\Model\Session::create([ '...
Opengraph URL: https://github.com/hyperf/database-pgsql/issues/9
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"pgsql-swoole driver can not prompt errors","articleBody":"## app/Controller/TestController.php\r\n```php\r\n #[RequestMapping(path: \"create\", methods: \"get\")]\r\n public function create(ResponseInterface $response)\r\n {\r\n $s = \\App\\Model\\Session::create([\r\n 'id' =\u003e '131',\r\n 'store_id' =\u003e 111,\r\n 'uuid' =\u003e 'abc',\r\n 'visitor_id' =\u003e '321',\r\n 'user_id' =\u003e '0',\r\n 'fingerprint' =\u003e '11111111111',\r\n 'client_ip' =\u003e '127.0.0.1',\r\n ]);\r\n var_dump($s);\r\n return $response-\u003eraw('create session'); \r\n }\r\n```\r\n## pgsql 日志\r\n```bash\r\n2023-04-23 13:43:37.125 CST,\"track\",\"track\",46662,\"172.17.0.3:36156\",6444c589.b646,7,\"PARSE\",2023-04-23 13:43:37 CST,3/48,0,LOG,00000,\"duration: 1.488 ms parse swoole_stmt_2: insert into \"\"sessions\"\" (\"\"id\"\", \"\"store_id\"\", \"\"uuid\"\", \"\"visitor_id\"\", \"\"user_id\"\", \"\"fingerprint\"\", \"\"client_ip\"\", \"\"updated_at_gmt\"\", \"\"created_at_gmt\"\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9)\",,,,,,,,,\"\",\"client backend\",,0\r\n2023-04-23 13:43:37.127 CST,\"track\",\"track\",46662,\"172.17.0.3:36156\",6444c589.b646,8,\"BIND\",2023-04-23 13:43:37 CST,3/49,0,LOG,00000,\"duration: 0.839 ms bind swoole_stmt_2: insert into \"\"sessions\"\" (\"\"id\"\", \"\"store_id\"\", \"\"uuid\"\", \"\"visitor_id\"\", \"\"user_id\"\", \"\"fingerprint\"\", \"\"client_ip\"\", \"\"updated_at_gmt\"\", \"\"created_at_gmt\"\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9)\",\"parameters: $1 = '131', $2 = '111', $3 = 'abc', $4 = '321', $5 = '0', $6 = '11111111111', $7 = '127.0.0.1', $8 = '2023-04-23 05:43:37', $9 = '2023-04-23 05:43:37'\",,,,,,,,\"\",\"client backend\",,0\r\n2023-04-23 13:43:37.127 CST,\"track\",\"track\",46662,\"172.17.0.3:36156\",6444c589.b646,9,\"INSERT\",2023-04-23 13:43:37 CST,3/49,0,LOG,00000,\"execute swoole_stmt_2: insert into \"\"sessions\"\" (\"\"id\"\", \"\"store_id\"\", \"\"uuid\"\", \"\"visitor_id\"\", \"\"user_id\"\", \"\"fingerprint\"\", \"\"client_ip\"\", \"\"updated_at_gmt\"\", \"\"created_at_gmt\"\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9)\",\"parameters: $1 = '131', $2 = '111', $3 = 'abc', $4 = '321', $5 = '0', $6 = '11111111111', $7 = '127.0.0.1', $8 = '2023-04-23 05:43:37', $9 = '2023-04-23 05:43:37'\",,,,,,,,\"\",\"client backend\",,0\r\n2023-04-23 13:43:37.128 CST,\"track\",\"track\",46662,\"172.17.0.3:36156\",6444c589.b646,10,\"INSERT\",2023-04-23 13:43:37 CST,3/49,1052,ERROR,23505,\"duplicate key value violates unique constraint \"\"sessions_pkey\"\"\",\"Key (store_id, uuid)=(111, abc) already exists.\",,,,,\"insert into \"\"sessions\"\" (\"\"id\"\", \"\"store_id\"\", \"\"uuid\"\", \"\"visitor_id\"\", \"\"user_id\"\", \"\"fingerprint\"\", \"\"client_ip\"\", \"\"updated_at_gmt\"\", \"\"created_at_gmt\"\") values ($1, $2, $3, $4, $5, $6, $7, $8, $9)\",,,\"\",\"client backend\",,0\r\n```\r\n## 响应结果\r\n\r\n\r\n\r\n## 问题\r\n当我的数据库驱动使用 `pgsql-swoole` 并使用 `model` 去创建新的数据时,无论写入的 SQL 在数据库里是否发生了错误。 model 总能返回一个正确的对象给我,但 pgsql 里却没有对应的数据。","author":{"url":"https://github.com/wuxi889","@type":"Person","name":"wuxi889"},"datePublished":"2023-04-23T06:09:46.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/9/database-pgsql/issues/9"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3957bedb-b7ff-35bf-ad88-dc4289ab1242 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DBCC:112DEB:F7E0AF:15CBF0D:696FC198 |
| html-safe-nonce | 3a8e43791d040c83da6481bc8e67a3fbecedc01b2b10bb610347fd6953f83adb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQkNDOjExMkRFQjpGN0UwQUY6MTVDQkYwRDo2OTZGQzE5OCIsInZpc2l0b3JfaWQiOiI4NDM4NjM1NTUzMTk5NDczMDQ4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | dd991366d0cbe5ff6e05b7385f6dba34b5572cc15adf05615b19b0c3b8c76302 |
| hovercard-subject-tag | issue:1679876653 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/hyperf/database-pgsql/9/issue_layout |
| twitter:image | https://opengraph.githubassets.com/384b7b6cd79950d75f669f810a55559a1ec48c16afc538b8a5fad52ea23fd3d0/hyperf/database-pgsql/issues/9 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/384b7b6cd79950d75f669f810a55559a1ec48c16afc538b8a5fad52ea23fd3d0/hyperf/database-pgsql/issues/9 |
| og:image:alt | app/Controller/TestController.php #[RequestMapping(path: "create", methods: "get")] public function create(ResponseInterface $response) { $s = \App\Model\Session::create([ 'id' => '131', 'store_id'... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | wuxi889 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 330ca0f04ee8ecef1da04306a0dd49293f64679ee9a4bd5eaf2e1272bfdcf145 |
| turbo-cache-control | no-preview |
| go-import | github.com/hyperf/database-pgsql git https://github.com/hyperf/database-pgsql.git |
| octolytics-dimension-user_id | 44228082 |
| octolytics-dimension-user_login | hyperf |
| octolytics-dimension-repository_id | 523003780 |
| octolytics-dimension-repository_nwo | hyperf/database-pgsql |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 523003780 |
| octolytics-dimension-repository_network_root_nwo | hyperf/database-pgsql |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 816ad575e27a390de2e2089ebe75261d12de9b37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width