{"id":475375,"date":"2025-09-17T07:16:27","date_gmt":"2025-09-17T07:16:27","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=475375"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=475375","title":{"rendered":"pgdbtemplate \u2014 \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0431\u0430\u0437 PostgreSQL \u0432 Go \u0447\u0435\u0440\u0435\u0437 \u0448\u0430\u0431\u043b\u043e\u043d\u044b. \u0423\u0441\u043a\u043e\u0440\u044f\u0435\u043c \u0442\u0435\u0441\u0442\u044b \u0432 1.5 \u0440\u0430\u0437\u0430"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0410\u043d\u0434\u0440\u0435\u0439, \u044f Go-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u0438\u0437 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0431\u043e\u043b\u0438 \u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441.<\/p>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u00ab\u041d\u0443 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u0436\u0434\u0430\u0442\u044c?\u00bb<\/h3>\n<p>\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0431\u0430\u0437\u044b \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"go\">func TestMyService(t *testing.T) {    \/\/ 1. \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0411\u0414 (CREATE DATABASE)    \/\/ 2. \u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 (N \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 CREATE TABLE, INDEX, FK...)    \/\/ 3. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0430\u043c \u0442\u0435\u0441\u0442    \/\/ 4. \u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0411\u0414 (DROP DATABASE)    \/\/ ... \u0438 \u0442\u0430\u043a \u0434\u043b\u044f \u041a\u0410\u0416\u0414\u041e\u0413\u041e \u0442\u0435\u0441\u0442\u0430.}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0428\u0430\u0433\u0438 1 \u0438 2 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u0441\u044a\u0435\u0434\u0430\u044f \u043a\u0443\u0447\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0427\u0435\u043c \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0432\u0430\u0448\u0430 \u0441\u0445\u0435\u043c\u0430 (\u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0438\u043d\u0434\u0435\u043a\u0441\u044b, \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0438), \u0442\u0435\u043c \u0434\u043e\u043b\u044c\u0448\u0435 \u0434\u043b\u0438\u0442\u0441\u044f \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441.<\/p>\n<h3>\u0420\u0435\u0448\u0435\u043d\u0438\u0435: \u0428\u0430\u0431\u043b\u043e\u043d\u044b (Templates) PostgreSQL<\/h3>\n<p>\u0412 PostgreSQL \u0435\u0441\u0442\u044c \u043c\u043e\u0449\u043d\u0430\u044f, \u043d\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u0430\u044f \u0444\u0438\u0447\u0430 \u2014 <strong>\u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 (Template Databases)<\/strong>. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u00ab\u0448\u0430\u0431\u043b\u043e\u043d\u043d\u0443\u044e\u00bb \u0431\u0430\u0437\u0443, \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0435\u0434\u0438\u043d\u043e\u0436\u0434\u044b \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c. \u0412\u0441\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0431\u0430\u0437\u044b \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"sql\">CREATE DATABASE my_fast_test_db TEMPLATE my_template_db;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u042d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 <strong>\u043c\u0433\u043d\u043e\u0432\u0435\u043d\u0438\u0435<\/strong>, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u0445\u0435\u043c\u044b.<\/p>\n<p>\u041c\u043e\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <code><strong>pgdbtemplate<\/strong><\/code> \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u044e \u044d\u0442\u0443 \u043c\u0430\u0433\u0438\u044e, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 API \u0434\u043b\u044f \u0432\u0430\u0448\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<h3>\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0437\u0430 5 \u043c\u0438\u043d\u0443\u0442<\/h3>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f:<\/p>\n<pre><code class=\"bash\">go get github.com\/andrei-polukhin\/pgdbtemplate<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0410 \u0432\u043e\u0442 \u0442\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u043a\u043e\u0434\u0435 \u0432\u0430\u0448\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432:<\/p>\n<pre><code class=\"go\">package mainimport (\"context\"\"fmt\"\"log\"\"github.com\/andrei-polukhin\/pgdbtemplate\"\"github.com\/andrei-polukhin\/pgdbtemplate-pgx\")func main() {\/\/ Create a connection provider with pooling options.connStringFunc := func(dbName string) string {return fmt.Sprintf(\"postgres:\/\/user:pass@localhost\/%s\", dbName)}provider := pgdbtemplatepgx.NewConnectionProvider(connStringFunc)\/\/ Create migration runner.migrationRunner := pgdbtemplate.NewFileMigrationRunner([]string{\".\/migrations\"}, pgdbtemplate.AlphabeticalMigrationFilesSorting,)\/\/ Create template manager.config := pgdbtemplate.Config{ConnectionProvider: provider,MigrationRunner:    migrationRunner,}tm, err := pgdbtemplate.NewTemplateManager(config)if err != nil {log.Fatal(err)}\/\/ Initialize template with migrations.ctx := context.Background()if err := tm.Initialize(ctx); err != nil {log.Fatal(err)}\/\/ Create test database (fast!).testDB, testDBName, err := tm.CreateTestDatabase(ctx)if err != nil {log.Fatal(err)}defer testDB.Close()defer tm.DropTestDatabase(ctx, testDBName)\/\/ Use testDB for testing...log.Printf(\"Test database %s ready!\", testDBName)}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h3>\u0426\u0438\u0444\u0440\u044b \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u0441\u0430\u043c\u0438 \u0437\u0430 \u0441\u0435\u0431\u044f<\/h3>\n<p>\u042f \u043f\u0440\u043e\u0432\u0435\u043b \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438, \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044f \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438 \u043f\u043e\u0434\u0445\u043e\u0434 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u044e\u0442:<\/p>\n<h4>\ud83d\ude80 \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 (\u043c\u0435\u043d\u044c\u0448\u0435 \u2014 \u043b\u0443\u0447\u0448\u0435)<\/h4>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0445\u0435\u043c\u044b<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0427\u0435\u0440\u0435\u0437 \u0448\u0430\u0431\u043b\u043e\u043d\u044b<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0423\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">1 \u0442\u0430\u0431\u043b\u0438\u0446\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">28.9 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">28.2 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.03x<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">3 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/p>\n<\/td>\n<td>\n<p align=\"left\">39.5 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">27.6 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>1.43x<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">5 \u0442\u0430\u0431\u043b\u0438\u0446 (+\u0438\u043d\u0434\u0435\u043a\u0441\u044b)<\/p>\n<\/td>\n<td>\n<p align=\"left\">43.1 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">28.8 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>1.50x<\/strong><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h4>\ud83d\udcc8 \u041c\u0430\u0441\u0441\u043e\u0432\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0431\u0430\u0437<\/h4>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0437<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0427\u0435\u0440\u0435\u0437 \u0448\u0430\u0431\u043b\u043e\u043d\u044b<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u042d\u043a\u043e\u043d\u043e\u043c\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">20 \u0431\u0430\u0437<\/p>\n<\/td>\n<td>\n<p align=\"left\">906.8 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">613.8 \u043c\u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>32%<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">50 \u0431\u0430\u0437<\/p>\n<\/td>\n<td>\n<p align=\"left\">2.29 \u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.53 \u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>33%<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">200 \u0431\u0430\u0437<\/p>\n<\/td>\n<td>\n<p align=\"left\">9.21 \u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">5.84 \u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>37%<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">500 \u0431\u0430\u0437<\/p>\n<\/td>\n<td>\n<p align=\"left\">22.31 \u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\">14.82 \u0441<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>34%<\/strong><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434: <strong>\u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u0445\u0435\u043c\u044b<\/strong>. \u041f\u043e\u043a\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u0442\u044c\u0441\u044f \u0441 \u0440\u043e\u0441\u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0430 \u0442\u0430\u0431\u043b\u0438\u0446 \u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432, \u043c\u0435\u0442\u043e\u0434 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u044b\u043c.<\/p>\n<h3>\u0427\u0442\u043e \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c?<\/h3>\n<ol>\n<li>\n<p><strong>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f:<\/strong> \u0421\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0431\u0430\u0437\u0430-\u0448\u0430\u0431\u043b\u043e\u043d, \u043d\u0430 \u043d\u0435\u0435 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043d\u0430\u043a\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435:<\/strong> \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u0430\u044f \u0431\u0430\u0437\u0430 \u0447\u0435\u0440\u0435\u0437 <code>CREATE DATABASE ... TEMPLATE<\/code> \u2014 \u044d\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u043e\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b PostgreSQL.<\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u0447\u0438\u0441\u0442\u043a\u0430:<\/strong> \u041f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0431\u0430\u0437\u044b \u0438 \u0441\u0430\u043c \u0448\u0430\u0431\u043b\u043e\u043d.<\/p>\n<\/li>\n<\/ol>\n<h3>\u0414\u043b\u044f \u043a\u043e\u0433\u043e \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442?<\/h3>\n<ul>\n<li>\n<p><strong>\u0423 \u0412\u0430\u0441 \u0431\u043e\u043b\u044c\u0448\u0435 10 \u0442\u0435\u0441\u0442\u043e\u0432<\/strong>, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p><strong>\u0412\u0430\u0448\u0430 \u0441\u0445\u0435\u043c\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043b\u043e\u0436\u043d\u0435\u0435<\/strong> 2-3 \u0442\u0430\u0431\u043b\u0438\u0446.<\/p>\n<\/li>\n<li>\n<p><strong>\u0412\u044b \u0447\u0430\u0441\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0435 \u0442\u0435\u0441\u0442\u044b<\/strong> \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0412\u0430\u0448 CI-\u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d<\/strong> \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u044d\u0442\u0430\u043f \u0441 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0411\u0414.<\/p>\n<\/li>\n<li>\n<p><strong>\u0412\u044b \u0446\u0435\u043d\u0438\u0442\u0435 \u0441\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f<\/strong> \u0438 \u043d\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u0436\u0434\u0430\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0435 10 \u0441\u0435\u043a\u0443\u043d\u0434 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438<\/h3>\n<ul>\n<li>\n<p><strong>GitHub \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439:<\/strong> <a href=\"https:\/\/github.com\/andrei-polukhin\/pgdbtemplate\" rel=\"noopener noreferrer nofollow\">github.com\/andrei-polukhin\/pgdbtemplate<\/a><\/p>\n<\/li>\n<li>\n<p><strong>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f (ENG):<\/strong> <a href=\"https:\/\/pkg.go.dev\/github.com\/andrei-polukhin\/pgdbtemplate\" rel=\"noopener noreferrer nofollow\">pkg.go.dev<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u0432\u0430\u0448\u0438\u043c \u0437\u0432\u0451\u0437\u0434\u043e\u0447\u043a\u0430\u043c \u043d\u0430 GitHub, \u043f\u0443\u043b-\u0440\u0435\u043a\u0432\u0435\u0441\u0442\u0430\u043c \u0438 issue! \u0427\u0442\u043e \u0434\u0443\u043c\u0430\u0435\u0442\u0435 \u043e \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435? \u0421\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u043b\u0438 \u0441 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0438 \u043a\u0430\u043a \u0440\u0435\u0448\u0430\u043b\u0438 \u0435\u0451 \u0440\u0430\u043d\u044c\u0448\u0435?<\/p>\n<p>\u0411\u043e\u043b\u044c\u0448\u043e\u0435 \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u0442\u0430!<\/p>\n<\/div>\n<p>\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\/ru\/articles\/947672\/\">https:\/\/habr.com\/ru\/articles\/947672\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0410\u043d\u0434\u0440\u0435\u0439, \u044f Go-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u0438\u0437 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0431\u043e\u043b\u0438 \u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441.\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u00ab\u041d\u0443 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u0436\u0434\u0430\u0442\u044c?\u00bb\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0431\u0430\u0437\u044b \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:func TestMyService(t *testing.T) {    \/\/ 1. \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0411\u0414 (CREATE DATABASE)    \/\/ 2. \u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 (N \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 CREATE TABLE, INDEX, FK&#8230;)    \/\/ 3. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0430\u043c \u0442\u0435\u0441\u0442    \/\/ 4. \u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0411\u0414 (DROP DATABASE)    \/\/ &#8230; \u0438 \u0442\u0430\u043a \u0434\u043b\u044f \u041a\u0410\u0416\u0414\u041e\u0413\u041e \u0442\u0435\u0441\u0442\u0430.}\u0428\u0430\u0433\u0438 1 \u0438 2 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u0441\u044a\u0435\u0434\u0430\u044f \u043a\u0443\u0447\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0427\u0435\u043c \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0432\u0430\u0448\u0430 \u0441\u0445\u0435\u043c\u0430 (\u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0438\u043d\u0434\u0435\u043a\u0441\u044b, \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0438), \u0442\u0435\u043c \u0434\u043e\u043b\u044c\u0448\u0435 \u0434\u043b\u0438\u0442\u0441\u044f \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441.\u0420\u0435\u0448\u0435\u043d\u0438\u0435: \u0428\u0430\u0431\u043b\u043e\u043d\u044b (Templates) PostgreSQL\u0412 PostgreSQL \u0435\u0441\u0442\u044c \u043c\u043e\u0449\u043d\u0430\u044f, \u043d\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u0430\u044f \u0444\u0438\u0447\u0430 \u2014 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 (Template Databases). \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u00ab\u0448\u0430\u0431\u043b\u043e\u043d\u043d\u0443\u044e\u00bb \u0431\u0430\u0437\u0443, \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0435\u0434\u0438\u043d\u043e\u0436\u0434\u044b \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c. \u0412\u0441\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0431\u0430\u0437\u044b \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:CREATE DATABASE my_fast_test_db TEMPLATE my_template_db;\u042d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u0438\u0435, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u0445\u0435\u043c\u044b.\u041c\u043e\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 pgdbtemplate \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u044e \u044d\u0442\u0443 \u043c\u0430\u0433\u0438\u044e, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 API \u0434\u043b\u044f \u0432\u0430\u0448\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432.\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0437\u0430 5 \u043c\u0438\u043d\u0443\u0442\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f:go get github.com\/andrei-polukhin\/pgdbtemplate\u0410 \u0432\u043e\u0442 \u0442\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u043a\u043e\u0434\u0435 \u0432\u0430\u0448\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432:package mainimport (&#171;context&#187;&#187;fmt&#187;&#187;log&#187;&#187;github.com\/andrei-polukhin\/pgdbtemplate&#187;&#187;github.com\/andrei-polukhin\/pgdbtemplate-pgx&#187;)func main() {\/\/ Create a connection provider with pooling options.connStringFunc := func(dbName string) string {return fmt.Sprintf(&#171;postgres:\/\/user:pass@localhost\/%s&#187;, dbName)}provider := pgdbtemplatepgx.NewConnectionProvider(connStringFunc)\/\/ Create migration runner.migrationRunner := pgdbtemplate.NewFileMigrationRunner([]string{&#171;.\/migrations&#187;}, pgdbtemplate.AlphabeticalMigrationFilesSorting,)\/\/ Create template manager.config := pgdbtemplate.Config{ConnectionProvider: provider,MigrationRunner:    migrationRunner,}tm, err := pgdbtemplate.NewTemplateManager(config)if err != nil {log.Fatal(err)}\/\/ Initialize template with migrations.ctx := context.Background()if err := tm.Initialize(ctx); err != nil {log.Fatal(err)}\/\/ Create test database (fast!).testDB, testDBName, err := tm.CreateTestDatabase(ctx)if err != nil {log.Fatal(err)}defer testDB.Close()defer tm.DropTestDatabase(ctx, testDBName)\/\/ Use testDB for testing&#8230;log.Printf(&#171;Test database %s ready!&#187;, testDBName)}\u0426\u0438\u0444\u0440\u044b \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u0441\u0430\u043c\u0438 \u0437\u0430 \u0441\u0435\u0431\u044f\u042f \u043f\u0440\u043e\u0432\u0435\u043b \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438, \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044f \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438 \u043f\u043e\u0434\u0445\u043e\u0434 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u044e\u0442:\ud83d\ude80 \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 (\u043c\u0435\u043d\u044c\u0448\u0435 \u2014 \u043b\u0443\u0447\u0448\u0435)\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0445\u0435\u043c\u044b\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434\u0427\u0435\u0440\u0435\u0437 \u0448\u0430\u0431\u043b\u043e\u043d\u044b\u0423\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u04351 \u0442\u0430\u0431\u043b\u0438\u0446\u043028.9 \u043c\u044128.2 \u043c\u04411.03&#215;3 \u0442\u0430\u0431\u043b\u0438\u0446\u044b39.5 \u043c\u044127.6 \u043c\u04411.43&#215;5 \u0442\u0430\u0431\u043b\u0438\u0446 (+\u0438\u043d\u0434\u0435\u043a\u0441\u044b)43.1 \u043c\u044128.8 \u043c\u04411.50x\ud83d\udcc8 \u041c\u0430\u0441\u0441\u043e\u0432\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0437\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043e\u0434\u0445\u043e\u0434\u0427\u0435\u0440\u0435\u0437 \u0448\u0430\u0431\u043b\u043e\u043d\u044b\u042d\u043a\u043e\u043d\u043e\u043c\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u043820 \u0431\u0430\u0437906.8 \u043c\u0441613.8 \u043c\u044132%50 \u0431\u0430\u04372.29 \u04411.53 \u044133%200 \u0431\u0430\u04379.21 \u04415.84 \u044137%500 \u0431\u0430\u043722.31 \u044114.82 \u044134%\u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434: \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u0445\u0435\u043c\u044b. \u041f\u043e\u043a\u0430 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u0442\u044c\u0441\u044f \u0441 \u0440\u043e\u0441\u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0430 \u0442\u0430\u0431\u043b\u0438\u0446 \u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432, \u043c\u0435\u0442\u043e\u0434 \u0441 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u044b\u043c.\u0427\u0442\u043e \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c?\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f: \u0421\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0431\u0430\u0437\u0430-\u0448\u0430\u0431\u043b\u043e\u043d, \u043d\u0430 \u043d\u0435\u0435 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043d\u0430\u043a\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438.\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435: \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u0430\u044f \u0431\u0430\u0437\u0430 \u0447\u0435\u0440\u0435\u0437 CREATE DATABASE &#8230; TEMPLATE \u2014 \u044d\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u043e\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b PostgreSQL.\u041e\u0447\u0438\u0441\u0442\u043a\u0430: \u041f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0431\u0430\u0437\u044b \u0438 \u0441\u0430\u043c \u0448\u0430\u0431\u043b\u043e\u043d.\u0414\u043b\u044f \u043a\u043e\u0433\u043e \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442?\u0423 \u0412\u0430\u0441 \u0431\u043e\u043b\u044c\u0448\u0435 10 \u0442\u0435\u0441\u0442\u043e\u0432, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445.\u0412\u0430\u0448\u0430 \u0441\u0445\u0435\u043c\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 2-3 \u0442\u0430\u0431\u043b\u0438\u0446.\u0412\u044b \u0447\u0430\u0441\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0435 \u0442\u0435\u0441\u0442\u044b \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.\u0412\u0430\u0448 CI-\u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u044d\u0442\u0430\u043f \u0441 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 \u0411\u0414.\u0412\u044b \u0446\u0435\u043d\u0438\u0442\u0435 \u0441\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u043d\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u0436\u0434\u0430\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0435 10 \u0441\u0435\u043a\u0443\u043d\u0434 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435.\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438GitHub \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439: github.com\/andrei-polukhin\/pgdbtemplate\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f (ENG): pkg.go.dev\u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u0432\u0430\u0448\u0438\u043c \u0437\u0432\u0451\u0437\u0434\u043e\u0447\u043a\u0430\u043c \u043d\u0430 GitHub, \u043f\u0443\u043b-\u0440\u0435\u043a\u0432\u0435\u0441\u0442\u0430\u043c \u0438 issue! \u0427\u0442\u043e \u0434\u0443\u043c\u0430\u0435\u0442\u0435 \u043e \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435? \u0421\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u043b\u0438 \u0441 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0438 \u043a\u0430\u043a \u0440\u0435\u0448\u0430\u043b\u0438 \u0435\u0451 \u0440\u0430\u043d\u044c\u0448\u0435?\u0411\u043e\u043b\u044c\u0448\u043e\u0435 \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u0442\u0430!\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 https:\/\/habr.com\/ru\/articles\/947672\/<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-475375","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/475375","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=475375"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/475375\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=475375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=475375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=475375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}