{"id":148691,"date":"2024-11-01T14:16:20","date_gmt":"2024-11-01T06:16:20","guid":{"rendered":"https:\/\/server.hk\/cnblog\/148691\/"},"modified":"2024-11-01T14:16:20","modified_gmt":"2024-11-01T06:16:20","slug":"%e9%98%bf%e9%87%8c%e9%9b%b2polardb%e6%96%b0%e7%89%88%e6%9c%ac%e7%af%80%e7%9c%8150%e6%88%90%e6%9c%ac%ef%bc%8c%e8%ae%93%e6%95%b8%e6%93%9a%e5%ba%ab%e9%96%8b%e7%99%bc%e5%83%8f%e6%90%ad%e7%a9%8d","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/148691\/","title":{"rendered":"\u963f\u91cc\u96f2PolarDB\u65b0\u7248\u672c\u7bc0\u770150%\u6210\u672c\uff0c\u8b93\u6578\u64da\u5eab\u958b\u767c\u50cf\u201c\u642d\u7a4d\u6728\u201d\u4e00\u6a23\u7c21\u55ae"},"content":{"rendered":"<h1 id=\"%e9%98%bf%e9%87%8c%e9%9b%b2polardb%e6%96%b0%e7%89%88%e6%9c%ac%e7%af%80%e7%9c%8150%e6%88%90%e6%9c%ac%ef%bc%8c%e8%ae%93%e6%95%b8%e6%93%9a%e5%ba%ab%e9%96%8b%e7%99%bc%e5%83%8f%e6%90%ad%e7%a9%8d-BrGivoytTU\">\u963f\u91cc\u96f2PolarDB\u65b0\u7248\u672c\u7bc0\u770150%\u6210\u672c\uff0c\u8b93\u6578\u64da\u5eab\u958b\u767c\u50cf\u201c\u642d\u7a4d\u6728\u201d\u4e00\u6a23\u7c21\u55ae<\/h1>\n<p>\u96a8\u8457\u96f2\u8a08\u7b97\u6280\u8853\u7684\u8fc5\u901f\u767c\u5c55\uff0c\u6578\u64da\u5eab\u7684\u7ba1\u7406\u548c\u958b\u767c\u4e5f\u8b8a\u5f97\u8d8a\u4f86\u8d8a\u7c21\u55ae\u3002\u963f\u91cc\u96f2\u6700\u8fd1\u63a8\u51fa\u7684PolarDB\u65b0\u7248\u672c\uff0c\u627f\u8afe\u80fd\u5920\u5e6b\u52a9\u4f01\u696d\u7bc0\u7701\u9ad8\u905450%\u7684\u6210\u672c\uff0c\u4e26\u4f7f\u6578\u64da\u5eab\u958b\u767c\u904e\u7a0b\u5982\u540c\u201c\u642d\u7a4d\u6728\u201d\u4e00\u822c\u7c21\u55ae\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e\u9019\u4e00\u65b0\u7248\u672c\u7684\u7279\u9ede\u53ca\u5176\u5c0d\u6578\u64da\u5eab\u958b\u767c\u7684\u5f71\u97ff\u3002<\/p>\n<h2 id=\"polardb%e7%9a%84%e6%a0%b8%e5%bf%83%e7%89%b9%e6%80%a7-BrGivoytTU\">PolarDB\u7684\u6838\u5fc3\u7279\u6027<\/h2>\n<p>PolarDB\u662f\u4e00\u6b3e\u517c\u5bb9MySQL\u548cPostgreSQL\u7684\u96f2\u539f\u751f\u6578\u64da\u5eab\uff0c\u65e8\u5728\u63d0\u4f9b\u9ad8\u6027\u80fd\u3001\u9ad8\u53ef\u7528\u6027\u548c\u9ad8\u64f4\u5c55\u6027\u7684\u89e3\u6c7a\u65b9\u6848\u3002\u65b0\u7248\u672c\u7684PolarDB\u5728\u4ee5\u4e0b\u5e7e\u500b\u65b9\u9762\u9032\u884c\u4e86\u986f\u8457\u6539\u9032\uff1a<\/p>\n<ul>\n<li><strong>\u6210\u672c\u6548\u76ca\uff1a<\/strong>\u65b0\u7248\u672c\u7684PolarDB\u901a\u904e\u512a\u5316\u8cc7\u6e90\u4f7f\u7528\u548c\u81ea\u52d5\u5316\u7ba1\u7406\uff0c\u5e6b\u52a9\u7528\u6236\u7bc0\u7701\u9ad8\u905450%\u7684\u904b\u71df\u6210\u672c\u3002\u9019\u5c0d\u65bc\u4e2d\u5c0f\u4f01\u696d\u5c24\u5176\u91cd\u8981\uff0c\u56e0\u70ba\u4ed6\u5011\u901a\u5e38\u9762\u81e8\u8cc7\u91d1\u6709\u9650\u7684\u6311\u6230\u3002<\/li>\n<li><strong>\u7c21\u5316\u958b\u767c\u6d41\u7a0b\uff1a<\/strong>PolarDB\u7684\u65b0\u7248\u672c\u63d0\u4f9b\u4e86\u66f4\u76f4\u89c0\u7684\u7528\u6236\u754c\u9762\u548cAPI\uff0c\u4f7f\u5f97\u958b\u767c\u8005\u80fd\u5920\u66f4\u5feb\u901f\u5730\u69cb\u5efa\u548c\u90e8\u7f72\u6578\u64da\u5eab\u61c9\u7528\u3002\u9019\u7a2e\u201c\u642d\u7a4d\u6728\u201d\u5f0f\u7684\u958b\u767c\u65b9\u5f0f\uff0c\u964d\u4f4e\u4e86\u6280\u8853\u9580\u6abb\uff0c\u8b93\u66f4\u591a\u7684\u958b\u767c\u8005\u80fd\u5920\u8f15\u9b06\u4e0a\u624b\u3002<\/li>\n<li><strong>\u9ad8\u6027\u80fd\uff1a<\/strong>\u65b0\u7248\u672c\u7684PolarDB\u5728\u6027\u80fd\u4e0a\u9032\u884c\u4e86\u512a\u5316\uff0c\u652f\u6301\u66f4\u9ad8\u7684\u4e26\u767c\u8a2a\u554f\u548c\u66f4\u5feb\u7684\u67e5\u8a62\u901f\u5ea6\u3002\u9019\u610f\u5473\u8457\u7528\u6236\u53ef\u4ee5\u5728\u66f4\u77ed\u7684\u6642\u9593\u5167\u7372\u53d6\u6578\u64da\uff0c\u63d0\u5347\u696d\u52d9\u904b\u71df\u6548\u7387\u3002<\/li>\n<li><strong>\u81ea\u52d5\u64f4\u5c55\uff1a<\/strong>PolarDB\u652f\u6301\u81ea\u52d5\u64f4\u5c55\u529f\u80fd\uff0c\u6839\u64da\u5be6\u969b\u9700\u6c42\u81ea\u52d5\u8abf\u6574\u8cc7\u6e90\u914d\u7f6e\uff0c\u78ba\u4fdd\u7cfb\u7d71\u5728\u9ad8\u5cf0\u671f\u4e5f\u80fd\u7a69\u5b9a\u904b\u884c\u3002<\/li>\n<\/ul>\n<h2 id=\"%e6%95%b8%e6%93%9a%e5%ba%ab%e9%96%8b%e7%99%bc%e7%9a%84%e7%b0%a1%e5%8c%96-BrGivoytTU\">\u6578\u64da\u5eab\u958b\u767c\u7684\u7c21\u5316<\/h2>\n<p>\u5728\u65b0\u7248\u672c\u4e2d\uff0c\u963f\u91cc\u96f2\u5f15\u5165\u4e86\u591a\u7a2e\u5de5\u5177\u548c\u529f\u80fd\uff0c\u65e8\u5728\u7c21\u5316\u6578\u64da\u5eab\u7684\u958b\u767c\u904e\u7a0b\u3002\u4f8b\u5982\uff0c\u4f7f\u7528\u8005\u53ef\u4ee5\u901a\u904e\u53ef\u8996\u5316\u754c\u9762\u8f15\u9b06\u8a2d\u8a08\u6578\u64da\u6a21\u578b\uff0c\u4e26\u5feb\u901f\u751f\u6210\u76f8\u61c9\u7684SQL\u8a9e\u53e5\u3002\u9019\u4e0d\u50c5\u63d0\u9ad8\u4e86\u958b\u767c\u6548\u7387\uff0c\u9084\u964d\u4f4e\u4e86\u51fa\u932f\u7684\u6982\u7387\u3002<\/p>\n<p>\u6b64\u5916\uff0cPolarDB\u9084\u63d0\u4f9b\u4e86\u8c50\u5bcc\u7684\u6587\u6a94\u548c\u7bc4\u4f8b\u4ee3\u78bc\uff0c\u5e6b\u52a9\u958b\u767c\u8005\u66f4\u5feb\u5730\u7406\u89e3\u548c\u4f7f\u7528\u5404\u7a2e\u529f\u80fd\u3002\u4ee5\u4e0b\u662f\u4e00\u500b\u7c21\u55ae\u7684\u7bc4\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u4f7f\u7528PolarDB\u7684API\u9032\u884c\u6578\u64da\u63d2\u5165\uff1a<\/p>\n<pre><code>\nimport requests\n\nurl = \"https:\/\/your-polar-db-endpoint\"\ndata = {\n    \"name\": \"John Doe\",\n    \"age\": 30\n}\n\nresponse = requests.post(url + \"\/insert\", json=data)\nprint(response.json())\n<\/code><\/pre>\n<p>\u9019\u6bb5\u4ee3\u78bc\u5c55\u793a\u4e86\u5982\u4f55\u901a\u904eAPI\u5c07\u6578\u64da\u63d2\u5165\u5230PolarDB\u4e2d\uff0c\u958b\u767c\u8005\u53ea\u9700\u7c21\u55ae\u7684\u5e7e\u884c\u4ee3\u78bc\u5373\u53ef\u5b8c\u6210\u64cd\u4f5c\uff0c\u986f\u793a\u4e86\u5176\u958b\u767c\u7684\u4fbf\u6377\u6027\u3002<\/p>\n<h2 id=\"%e7%b5%90%e8%ab%96-BrGivoytTU\">\u7d50\u8ad6<\/h2>\n<p>\u963f\u91cc\u96f2PolarDB\u7684\u65b0\u7248\u672c\u4e0d\u50c5\u5728\u6210\u672c\u4e0a\u70ba\u4f01\u696d\u5e36\u4f86\u4e86\u986f\u8457\u7684\u7bc0\u7701\uff0c\u9084\u901a\u904e\u7c21\u5316\u958b\u767c\u6d41\u7a0b\uff0c\u4f7f\u5f97\u6578\u64da\u5eab\u958b\u767c\u8b8a\u5f97\u66f4\u52a0\u5bb9\u6613\u3002\u9019\u4e00\u7cfb\u5217\u7684\u6539\u9032\u5c07\u6709\u52a9\u65bc\u4f01\u696d\u66f4\u5feb\u5730\u9069\u61c9\u5e02\u5834\u8b8a\u5316\uff0c\u63d0\u5347\u7af6\u722d\u529b\u3002<\/p>\n<p>\u5c0d\u65bc\u5e0c\u671b\u5728\u96f2\u7aef\u74b0\u5883\u4e2d\u5c0b\u627e\u9ad8\u6548\u89e3\u6c7a\u65b9\u6848\u7684\u4f01\u696d\u4f86\u8aaa\uff0cPolarDB\u7121\u7591\u662f\u4e00\u500b\u503c\u5f97\u8003\u616e\u7684\u9078\u64c7\u3002\u82e5\u60a8\u5c0d\u65bc\u96f2\u670d\u52d9\u6709\u9032\u4e00\u6b65\u7684\u9700\u6c42\uff0c\u6b61\u8fce\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u4e86\u89e3\u66f4\u591a\u8cc7\u8a0a\uff0c\u63a2\u7d22\u6211\u5011\u7684<a href=\"https:\/\/server.hk\">VPS<\/a>\u548c\u5176\u4ed6\u96f2\u670d\u52d9\u89e3\u6c7a\u65b9\u6848\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u963f\u91cc\u96f2PolarDB\u65b0\u7248\u672c\u52a9\u60a8\u7bc0\u770150%\u6210\u672c\uff0c\u8b93\u6578\u64da\u5eab\u958b\u767c\u8b8a\u5f97\u7c21\u55ae\u5982\u201c\u642d\u7a4d\u6728\u201d\uff0c\u63d0\u5347\u6548\u7387\u8207\u9748\u6d3b\u6027\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-148691","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/148691","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=148691"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/148691\/revisions"}],"predecessor-version":[{"id":148692,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/148691\/revisions\/148692"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=148691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=148691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=148691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}