{"id":289213,"date":"2018-09-10T20:30:02","date_gmt":"2018-09-10T16:30:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=289213"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=289213","title":{"rendered":"\u0417\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 SOCI \u2014 C++ \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0431\u0430\u0437\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0445"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<h1 id=\"vstuplenie\">\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h1>\n<p>  <\/p>\n<p>\u0421\u0430\u043c\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u0430\u043a\u0438 \u0437\u0440\u0435\u043b\u0430\u044f, \u2014 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0435\u043b\u0438\u0437 \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435<br \/>  \u0434\u0430\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0430\u0436 2004 \u0433\u043e\u0434\u043e\u043c. \u042f \u0431\u044b\u043b \u0443\u0434\u0438\u0432\u043b\u0451\u043d \u043a\u043e\u0433\u0434\u0430 \u0445\u0430\u0431\u0440 \u0432 \u043f\u043e\u0438\u0441\u043a\u0435<br \/>  \u043d\u0435 \u0432\u044b\u0434\u0430\u043b \u043c\u043d\u0435 \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u044b \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c<br \/>  \u043e\u0431 \u044d\u0442\u043e\u0439 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435.<\/p>\n<p>  <\/p>\n<p><strong>SOCI<\/strong> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/ORM\">ORM<\/a>, \u0447\u0435\u0440\u0435\u0437 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e type_conversion.<\/p>\n<p>  <\/p>\n<p>\u0412 <strong>SOCI<\/strong> \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u0431\u044d\u043a\u0435\u043d\u0434\u044b \u0434\u043b\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li>Firebird<\/li>\n<li>MySQL<\/li>\n<li>Oracle<\/li>\n<li>PostgreSQL<\/li>\n<li>SQLite<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u042f \u043d\u0435 \u0441\u0442\u0430\u043d\u0443 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u043c\u0430\u043d\u0443\u0430\u043b\u044b \u0438\u043b\u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u043a\u043e\u0434 \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432,<br \/>  \u0430 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c (\u0441 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0439)<br \/>  \u043a\u043e\u0434 \u0438\u0437 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u0435\u0439 \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0439.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h1 id=\"ustanovka\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430<\/h1>\n<p>  <\/p>\n<p>\u041a\u0430\u0447\u0430\u0435\u043c <a href=\"https:\/\/github.com\/SOCI\/soci\/archive\/3.2.3.zip\">\u0440\u0435\u043b\u0438\u0437<\/a>, \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c, \u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<p>  <\/p>\n<p>\u0412 <strong>Windows<\/strong><\/p>\n<p>  <\/p>\n<blockquote><p>$ mkdir build &amp;&amp; cd build &amp;&amp; cmake -G&#187;Visual Studio 15 2017 Win64\u201d ..<\/p><\/blockquote>\n<p>\u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 Visual Studio \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c.<\/p>\n<p>  <\/p>\n<p>\u0412 <strong>nix<\/strong><\/p>\n<p>  <\/p>\n<blockquote><p>$ mkdir build &amp;&amp; cd build &amp;&amp; cmake\u2026 &amp;&amp; sudo make install<\/p><\/blockquote>\n<p>  <\/p>\n<h1 id=\"pishem-pul-dlya-soedineniy-s-bazoy-dannyh-bd\">\u041f\u0438\u0448\u0435\u043c \u043f\u0443\u043b \u0434\u043b\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0411\u0414)<\/h1>\n<p>  <\/p>\n<pre><code>#ifndef db_pool_hpp #define db_pool_hpp  \/\/ \u0434\u0430 \u043f\u0440\u043e\u0441\u0442\u044f\u0442 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u041d\u0415 GCC, \u043d\u043e \u044f \u043d\u0435 \u0437\u043d\u0430\u044e \u043a\u0430\u043a \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \/\/ \u0432\u043e\u0440\u043d\u0438\u043d\u0433\u0438 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432, \u043e deprecated auto_ptr #pragma GCC diagnostic push #pragma GCC diagnostic ignored \"-Wdeprecated-declarations\" #pragma GCC diagnostic ignored \"-Wmaybe-uninitialized\" #include &lt;soci\/soci.h&gt; #include &lt;soci\/connection-pool.h&gt; \/\/\/ \\note \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \"postgresql\" \u043d\u0430 \"mysql\" \u0438\u043b\u0438 \"sqlite3\" - \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0431\u044d\u043a\u0435\u043d\u0434\u0430 #include &lt;soci\/postgresql\/soci-postgresql.h&gt; #pragma GCC diagnostic pop  #include &lt;iostream&gt; #include &lt;string&gt;  class db_pool {   soci::connection_pool* pool_;   std::size_t pool_size_; public:   db_pool():pool_(nullptr),pool_size_(0) {}   ~db_pool() { close(); }    soci::connection_pool* get_pool() { return pool_; }    bool connect(const std::string&amp; conn_str, std::size_t n = 5) {     if (pool_ != nullptr) { close(); }     bool ret = false;     int is_connected = 0;      if (!(pool_ = new soci::connection_pool((pool_size_ = n)))) return false;      try {       soci::indicator ind;       for (std::size_t _i = 0; _i &lt; pool_size_; _i++) {         soci::session&amp; sql = pool_-&gt;at(_i);         \/\/ \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u0411\u0414         sql.open(conn_str);         \/\/ \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c         sql &lt;&lt; \"SELECT 1;\", soci::into(is_connected, ind);         if (!is_connected) break;         else if (_i+1 &lt; pool_size_) is_connected = 0;       }     } catch (std::exception const &amp; e) { std::cerr &lt;&lt; e.what() &lt;&lt; std::endl; }      if (!is_connected) close();      return (pool_ != nullptr);   }    void close () {     if (pool_ != nullptr) {       try {         for (std::size_t _i = 0; _i &lt; pool_size_; _i++) {           soci::session&amp; sql = pool_-&gt;at(_i);           sql.close();         }         delete pool_; pool_ = nullptr;       } catch (std::exception const &amp; e) { std::cerr &lt;&lt; e.what() &lt;&lt; std::endl; }       pool_size_ = 0;     }   } };  #endif<\/code><\/pre>\n<p>  <\/p>\n<h1 id=\"opredelyaem-strukturu-tablicy-v-klasse-user_info\">\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 user_info<\/h1>\n<p>  <\/p>\n<pre><code>#ifndef user_info_hpp #define user_info_hpp  #include \"db_pool.hpp\" #include &lt;ctime&gt; #include &lt;vector&gt; #include &lt;regex&gt; #include &lt;numeric&gt; #include &lt;algorithm&gt; #include &lt;iomanip&gt;  \/\/ \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444-\u0438\u0438 \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e template&lt;typename T&gt; static void extract_integers(const std::string&amp; str, std::vector&lt;T&gt;&amp; result ) {   result.clear();   using re_iterator = std::regex_iterator&lt;std::string::const_iterator&gt;;   using re_iterated = re_iterator::value_type;   std::regex re(\"(\\\\d+)\");   re_iterator rit(str.begin(), str.end(), re);   re_iterator rend;   std::transform(rit, rend, std::back_inserter(result), [](const re_iterated&amp; it){return std::stoul(it[1]); }); }  template&lt;typename T&gt; static void split_integers(std::string&amp; str, const std::vector&lt;T&gt;&amp; arr) {   str.clear();   str = \"{\";   if (arr.size()) {     str += std::accumulate(arr.begin()+1, arr.end(), std::to_string(arr[0]),                            [](const std::string&amp; a, int b){return a + ',' + std::to_string(b);});   }   str += \"}\"; }  \/\/ \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b `users' class user_info { public:    int id; \/\/ \u0430\u0439\u0434\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f   std::tm birthday; \/\/ \u0434\u0435\u043d\u044c \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f   std::string firstname, lastname; \/\/ \u0438\u043c\u044f \u0438 \u0444\u0430\u043c\u0438\u043b\u0438\u044f   std::vector&lt;int&gt; friends; \/\/ \u0430\u0439\u0434\u0438\u0448\u043d\u0438\u043a\u0438 \u0434\u0440\u0443\u0437\u0435\u0439    user_info():id(0),birthday(0),firstname(),lastname(),friends() {}    void print() {     std::cout.imbue(std::locale(\"ru_RU.utf8\"));     std::cout &lt;&lt; \"id: \" &lt;&lt; id &lt;&lt; std::endl;     std::cout &lt;&lt; \"birthday: \" &lt;&lt; std::put_time(&amp;birthday, \"%c %Z\") &lt;&lt; std::endl;     std::cout &lt;&lt; \"firstname: \" &lt;&lt; firstname &lt;&lt; std::endl;     std::cout &lt;&lt; \"lastname: \" &lt;&lt; lastname &lt;&lt; std::endl;     std::string arr_str;     split_integers(arr_str, friends);     std::cout &lt;&lt; \"friends: \" &lt;&lt; arr_str &lt;&lt; std::endl;   }    void clear() { id = 0; tm = {0}; firstname = lastname = \"\"; friends.clear(); }  };  \/\/ \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438, \u0432 SOCI \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440\u044b namespace soci {    template&lt;&gt; struct type_conversion&lt;user_info&gt; {     typedef values base_type;      static void from_base(values const&amp; v, indicator ind, user_info&amp; p) {       if (ind == i_null) return;       try {         p.id = v.get&lt;int&gt;(\"id\", 0);         p.birthday = v.get&lt;std::tm&gt;(\"birthday\", {});         p.firstname = v.get&lt;std::string&gt;(\"firstname\", {});         p.lastname = v.get&lt;std::string&gt;(\"lastname\", {});          std::string arr_str = v.get&lt;std::string&gt;(\"friends\", {});         extract_integers(arr_str, p.friends);       } catch (std::exception const &amp; e) { std::cerr &lt;&lt; e.what() &lt;&lt; std::endl; }     }      static void to_base(const user_info&amp; p, values&amp; v, indicator&amp; ind) {       try {         v.set(\"id\", p.id);         v.set(\"birthday\", p.birthday);         v.set(\"firstname\", p.firstname);         v.set(\"lastname\", p.lastname);          std::string arr_str;         split_integers(arr_str, p.friends);         v.set(\"friends\", arr_str);         return;       } catch (std::exception const &amp; e) { std::cerr &lt;&lt; e.what() &lt;&lt; std::endl; }       ind = i_null;     }    };  }  #endif<\/code><\/pre>\n<p>  <\/p>\n<h1 id=\"testiruem-nash-kod\">\u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448 \u043a\u043e\u0434<\/h1>\n<p>  <\/p>\n<pre><code>#ifndef test_cxx #define test_cxx  #include \"user_info.hpp\"  \/\/ g++ -std=c++11 test.cxx -o test -lsoci_core -lsoci_postgresql &amp;&amp; .\/test int main() {    db_pool db;    \/\/\/ \\note \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \"postgresql\" \u043d\u0430 \u0441\u0432\u043e\u0439 \u0431\u044d\u043a\u0435\u043d\u0434, \u0442\u0430\u043a\u0436\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u0438\u043c\u044f \u0411\u0414 \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u043f\u0430\u0440\u043e\u043b\u0435\u043c   if (db.connect(\"postgresql:\/\/host='localhost' dbname='test' user='test' password='test'\")) {     try {       soci::session sql(*db.get_pool());       \/\/ \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0435\u0441\u043b\u0438 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442       sql &lt;&lt; \"CREATE TABLE IF NOT EXISTS users(id serial PRIMARY KEY, birthday timestamp(6) without time zone DEFAULT now(), firstname text DEFAULT NULL, lastname text DEFAULT NULL, friends integer[] DEFAULT NULL);\";        \/\/ \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u043e\u043b\u044f       user_info info;       std::time_t t = std::time(nullptr);       info.birthday = *std::localtime(&amp;t);       info.firstname = \"Dmitrij\";       info.lastname = \"Volin\";       info.friends = {1,2,3,4,5,6,7,8,9};        int id = 0; \/\/ id \u043d\u043e\u0432\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 (\u043f\u043e\u043b\u0435 id \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f)       soci::indicator ind;        sql &lt;&lt; \"INSERT INTO users(birthday, firstname, lastname, friends) VALUES(:birthday, :firstname, :lastname, :friends) RETURNING id;\", soci::use(info), soci::into(id, ind);        std::cout &lt;&lt; \"id \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f: \" &lt;&lt; id &lt;&lt; std::endl;        \/\/ \u043e\u0447\u0438\u0449\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u0431\u043e\u0440\u043a\u043e\u0439 \u0438\u0437 \u0411\u0414       info.clear();        \/\/ \u0434\u0435\u043b\u0430\u0435\u043c \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043e\u0447\u0438\u0449\u0435\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443       sql &lt;&lt; \"SELECT * FROM users WHERE id=:userid;\", soci::use(id, \"userid\"), soci::into(info, ind);        \/\/ \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435       info.print();        \/\/ \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443       sql &lt;&lt; \"DROP TABLE IF EXISTS users;\";      } catch (std::exception const &amp; e) { std::cerr &lt;&lt; e.what() &lt;&lt; std::endl; }   }    return 0; }  #endif<\/code><\/pre>\n<p>  <\/p>\n<h1 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h1>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043c\u0430\u043b\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 (\u0435\u0441\u043b\u0438 \u0443 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441), \u043c\u043e\u0433\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c<br \/>  \u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043f\u043e\u043b\u044f\u043c\u0438 \u0442\u0438\u043f\u0430 BLOB \u2014 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a.<br \/>  \u0410 \u0442\u0430\u043a\u0436\u0435 \u043e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f\u0445 \u0438 prepared-\u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445.<\/p>\n<p>  <\/p>\n<h1 id=\"ssylka-na-proekt\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442<\/h1>\n<p>  <\/p>\n<p><a href=\"https:\/\/github.com\/SOCI\/soci\">SOCI \u043d\u0430 github<\/a><br \/>  <a href=\"http:\/\/soci.sourceforge.net\/\">SOCI \u0434\u043e\u043c\u0430\u0448\u043d\u044f\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430<\/a><\/p>\n<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/post\/422881\/\"> https:\/\/habr.com\/post\/422881\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<h1 id=\"vstuplenie\">\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h1>\n<p>  <\/p>\n<p>\u0421\u0430\u043c\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u0430\u043a\u0438 \u0437\u0440\u0435\u043b\u0430\u044f, \u2014 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0435\u043b\u0438\u0437 \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435<br \/>  \u0434\u0430\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0430\u0436 2004 \u0433\u043e\u0434\u043e\u043c. \u042f \u0431\u044b\u043b \u0443\u0434\u0438\u0432\u043b\u0451\u043d \u043a\u043e\u0433\u0434\u0430 \u0445\u0430\u0431\u0440 \u0432 \u043f\u043e\u0438\u0441\u043a\u0435<br \/>  \u043d\u0435 \u0432\u044b\u0434\u0430\u043b \u043c\u043d\u0435 \u043d\u0438 \u043e\u0434\u043d\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u044b \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c<br \/>  \u043e\u0431 \u044d\u0442\u043e\u0439 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435.<\/p>\n<p>  <\/p>\n<p><strong>SOCI<\/strong> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/ORM\">ORM<\/a>, \u0447\u0435\u0440\u0435\u0437 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e type_conversion.<\/p>\n<p>  <\/p>\n<p>\u0412 <strong>SOCI<\/strong> \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u0431\u044d\u043a\u0435\u043d\u0434\u044b \u0434\u043b\u044f:<\/p>\n<p>  <\/p>\n<ul>\n<li>Firebird<\/li>\n<li>MySQL<\/li>\n<li>Oracle<\/li>\n<li>PostgreSQL<\/li>\n<li>SQLite<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u042f \u043d\u0435 \u0441\u0442\u0430\u043d\u0443 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u043c\u0430\u043d\u0443\u0430\u043b\u044b \u0438\u043b\u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u043a\u043e\u0434 \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432,<br \/>  \u0430 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c (\u0441 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0439)<br \/>  \u043a\u043e\u0434 \u0438\u0437 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u0435\u0439 \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0439.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-289213","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/289213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=289213"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/289213\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=289213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=289213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=289213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}