{"id":5681,"date":"2025-11-20T17:00:52","date_gmt":"2025-11-20T13:30:52","guid":{"rendered":"https:\/\/parmin.cloud\/blog\/?p=5681"},"modified":"2025-12-01T11:23:13","modified_gmt":"2025-12-01T07:53:13","slug":"%d9%be%d8%b3%d8%aa-%d8%ac%d8%af%db%8c%d8%af-3","status":"publish","type":"post","link":"https:\/\/parmin.cloud\/blog\/%d9%be%d8%b3%d8%aa-%d8%ac%d8%af%db%8c%d8%af-3\/","title":{"rendered":"\u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 node-postgres \u0628\u0631\u0627\u06cc \u0627\u062a\u0635\u0627\u0644 \u0648 \u06a9\u0627\u0631 \u0628\u0627 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 PostgreSQL \u062f\u0631 Node.js"},"content":{"rendered":"<p>\u0627\u06a9\u0648\u0633\u06cc\u0633\u062a\u0645 Node.js \u0645\u062c\u0645\u0648\u0639\u0647\u200c\u0627\u06cc \u0627\u0632 \u0627\u0628\u0632\u0627\u0631\u0647\u0627 \u0628\u0631\u0627\u06cc \u0627\u0631\u062a\u0628\u0627\u0637 \u0628\u0627 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647\u200c\u0647\u0627 \u0641\u0631\u0627\u0647\u0645 \u0645\u06cc\u200c\u06a9\u0646\u062f. \u06cc\u06a9\u06cc \u0627\u0632 \u0627\u06cc\u0646 \u0627\u0628\u0632\u0627\u0631\u0647\u0627 node-postgres \u0627\u0633\u062a \u06a9\u0647 \u0634\u0627\u0645\u0644 \u0645\u0627\u0698\u0648\u0644\u200c\u0647\u0627\u06cc\u06cc \u0628\u0631\u0627\u06cc \u0627\u0631\u062a\u0628\u0627\u0637 Node.js \u0628\u0627 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 PostgreSQL \u0645\u06cc\u200c\u0628\u0627\u0634\u062f. \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 node-postgres \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0647\u0627\u06cc\u06cc \u0628\u0646\u0648\u06cc\u0633\u06cc\u062f \u06a9\u0647 \u0627\u0645\u06a9\u0627\u0646 \u062f\u0633\u062a\u0631\u0633\u06cc \u0628\u0647 \u062f\u0627\u062f\u0647\u200c\u0647\u0627 \u0648 \u0630\u062e\u06cc\u0631\u0647 \u0622\u0646\u0647\u0627 \u062f\u0631 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 PostgreSQL \u0631\u0627 \u0641\u0631\u0627\u0647\u0645 \u0645\u06cc\u200c\u0622\u0648\u0631\u0646\u062f.<\/p>\n<p>\u062f\u0631 \u0627\u06cc\u0646 \u0622\u0645\u0648\u0632\u0634\u060c \u0634\u0645\u0627 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 node-postgres \u0628\u0647 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 PostgreSQL \u0645\u062a\u0635\u0644 \u0634\u062f\u0647 \u0648 \u0639\u0645\u0644\u06cc\u0627\u062a \u067e\u0631\u0633\u200c\u0648\u062c\u0648 \u0627\u0646\u062c\u0627\u0645 \u062e\u0648\u0627\u0647\u06cc\u062f \u062f\u0627\u062f. \u0627\u0628\u062a\u062f\u0627 \u06cc\u06a9 \u06a9\u0627\u0631\u0628\u0631 \u0648 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 \u062f\u0631 Postgres \u0645\u06cc\u200c\u0633\u0627\u0632\u06cc\u062f. \u0633\u067e\u0633 \u0628\u0631\u0646\u0627\u0645\u0647 \u062e\u0648\u062f \u0631\u0627 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0645\u0627\u0698\u0648\u0644 node-postgres \u0628\u0647 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 \u0645\u062a\u0635\u0644 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u062f. \u062f\u0631 \u0627\u062f\u0627\u0645\u0647 \u062f\u0627\u062f\u0647\u200c\u0647\u0627 \u0631\u0627 \u062f\u0631\u062c\u060c \u0628\u0627\u0632\u06cc\u0627\u0628\u06cc \u0648 \u0648\u06cc\u0631\u0627\u06cc\u0634 \u062e\u0648\u0627\u0647\u06cc\u062f \u06a9\u0631\u062f.<\/p>\n<h2>\u067e\u06cc\u0634\u200c\u0646\u06cc\u0627\u0632\u0647\u0627\u06cc \u0622\u0645\u0648\u0632\u0634<\/h2>\n<ul>\n<li>\u06cc\u06a9 \u062d\u0633\u0627\u0628 \u06a9\u0627\u0631\u0628\u0631\u06cc \u063a\u06cc\u0631 \u0631\u0648\u062a \u0628\u0627 \u062f\u0633\u062a\u0631\u0633\u06cc sudo \u0648 \u0641\u0627\u06cc\u0631\u0648\u0627\u0644 \u0641\u0639\u0627\u0644 \u062f\u0631 \u0627\u0648\u0628\u0648\u0646\u062a\u0648 20.04.<\/li>\n<li>\u0646\u0635\u0628 Node.js \u0631\u0648\u06cc \u0627\u0648\u0628\u0648\u0646\u062a\u0648.<\/li>\n<li>\u0646\u0635\u0628 PostgreSQL \u0631\u0648\u06cc \u0633\u0631\u0648\u0631.<\/li>\n<li>\u062f\u0627\u0646\u0634 \u067e\u0627\u06cc\u0647 \u062f\u0631 \u0646\u0648\u0634\u062a\u0646 \u06a9\u0648\u0626\u0631\u06cc\u200c\u0647\u0627\u06cc PostgreSQL.<\/li>\n<li>\u0622\u0634\u0646\u0627\u06cc\u06cc \u0628\u0627 \u0646\u0648\u0634\u062a\u0646 \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0647\u0627\u06cc Node.js.<\/li>\n<li>\u062f\u0631\u06a9 \u0645\u0642\u062f\u0645\u0627\u062a\u06cc \u0627\u0632 \u062a\u0648\u0627\u0628\u0639 \u0646\u0627\u0647\u0645\u0632\u0645\u0627\u0646 \u062f\u0631 \u062c\u0627\u0648\u0627\u0627\u0633\u06a9\u0631\u06cc\u067e\u062a.<\/li>\n<\/ul>\n<h2>\u0627\u06cc\u062c\u0627\u062f \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc \u067e\u0631\u0648\u0698\u0647 \u0648 \u0646\u0635\u0628 node-postgres<\/h2>\n<p>\u0627\u0628\u062a\u062f\u0627 \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc \u067e\u0631\u0648\u0698\u0647 \u0631\u0627 \u0628\u0633\u0627\u0632\u06cc\u062f:<\/p>\n<pre><code>mkdir my-project\r\n<\/code><\/pre>\n<p>\u0648\u0627\u0631\u062f \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc \u0634\u0648\u06cc\u062f:<\/p>\n<pre><code>cd my-project\r\n<\/code><\/pre>\n<p>\u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc \u0631\u0627 \u0628\u0627 \u0627\u06cc\u062c\u0627\u062f \u0641\u0627\u06cc\u0644 <code>package.json<\/code> \u0622\u0645\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>npm init -y\r\n<\/code><\/pre>\n<p>\u0633\u067e\u0633 \u0645\u0627\u0698\u0648\u0644 node-postgres \u0631\u0627 \u0646\u0635\u0628 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>npm install pg\r\n<\/code><\/pre>\n<p>\u0627\u06a9\u0646\u0648\u0646 \u062f\u0627\u06cc\u0631\u06a9\u062a\u0648\u0631\u06cc \u067e\u0631\u0648\u0698\u0647 \u0634\u0645\u0627 \u0622\u0645\u0627\u062f\u0647 \u0648 node-postgres \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0648\u0627\u0628\u0633\u062a\u06af\u06cc \u0646\u0635\u0628 \u0634\u062f\u0647 \u0627\u0633\u062a. \u0622\u0645\u0627\u062f\u0647\u200c\u0627\u06cc\u062f \u062a\u0627 \u06a9\u0627\u0631\u0628\u0631 \u0648 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 \u062c\u062f\u06cc\u062f\u06cc \u062f\u0631 Postgres \u0628\u0633\u0627\u0632\u06cc\u062f.<\/p>\n<h2>\u0627\u06cc\u062c\u0627\u062f \u06a9\u0627\u0631\u0628\u0631 \u0648 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 \u062f\u0631 PostgreSQL<\/h2>\n<p>\u0632\u0645\u0627\u0646\u06cc \u06a9\u0647 PostgreSQL \u0631\u0627 \u0631\u0648\u06cc \u0627\u0648\u0628\u0648\u0646\u062a\u0648 \u0646\u0635\u0628 \u0645\u06cc\u200c\u06a9\u0646\u06cc\u062f\u060c \u0628\u0647 \u0635\u0648\u0631\u062a \u067e\u06cc\u0634\u200c\u0641\u0631\u0636 \u06cc\u06a9 \u06a9\u0627\u0631\u0628\u0631 \u0648 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 \u0628\u0647 \u0646\u0627\u0645 postgres \u0633\u0627\u062e\u062a\u0647 \u0645\u06cc\u200c\u0634\u0648\u062f. \u0627\u06cc\u0646 \u06a9\u0627\u0631\u0628\u0631 \u0627\u0645\u06a9\u0627\u0646 \u0627\u0646\u062c\u0627\u0645 \u0639\u0645\u0644\u06cc\u0627\u062a \u0645\u062f\u06cc\u0631\u06cc\u062a\u06cc \u0645\u062b\u0644 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0627\u0631\u0628\u0631\u0627\u0646 \u0648 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647\u200c\u0647\u0627\u06cc \u062c\u062f\u06cc\u062f \u0631\u0627 \u0641\u0631\u0627\u0647\u0645 \u0645\u06cc\u200c\u06a9\u0646\u062f.<\/p>\n<p>\u0628\u0631\u0627\u06cc \u0648\u0631\u0648\u062f \u0628\u0647 shell \u067e\u0633\u062a\u06af\u0631\u0633 \u0628\u0627 \u06a9\u0627\u0631\u0628\u0631 postgres\u060c \u0627\u0628\u062a\u062f\u0627 \u06a9\u0627\u0631\u0628\u0631 \u0627\u0648\u0628\u0648\u0646\u062a\u0648 \u0631\u0627 \u0628\u0647 postgres \u062a\u063a\u06cc\u06cc\u0631 \u062f\u0627\u062f\u0647 \u0648 \u0633\u067e\u0633 \u0628\u0647 \u067e\u0633\u062a\u06af\u0631\u0633 \u0648\u0635\u0644 \u0634\u0648\u06cc\u062f:<\/p>\n<pre><code>sudo -i -u postgres\r\npsql\r\n<\/code><\/pre>\n<p>\u062d\u0627\u0644\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u06a9\u0627\u0631\u0628\u0631 \u062c\u062f\u06cc\u062f\u06cc \u0628\u0627 \u0631\u0645\u0632 \u0639\u0628\u0648\u0631 \u0642\u0648\u06cc \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f (\u0645\u062b\u0644\u0627\u064b fish_user):<\/p>\n<pre><code>CREATE ROLE fish_user WITH LOGIN PASSWORD 'strongpassword';\r\n<\/code><\/pre>\n<p>\u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 \u062c\u062f\u06cc\u062f\u06cc \u0628\u0633\u0627\u0632\u06cc\u062f \u0648 \u0645\u0627\u0644\u06a9\u06cc\u062a \u0622\u0646 \u0631\u0627 \u0628\u0647 \u06a9\u0627\u0631\u0628\u0631 \u062c\u062f\u06cc\u062f \u0628\u0633\u067e\u0627\u0631\u06cc\u062f:<\/p>\n<pre><code>CREATE DATABASE fish OWNER fish_user;\r\n<\/code><\/pre>\n<p>\u0628\u0631\u0627\u06cc \u062e\u0631\u0648\u062c \u0627\u0632 \u0645\u062d\u06cc\u0637 \u067e\u0633\u062a\u06af\u0631\u0633 \u062f\u0633\u062a\u0648\u0631 \u0632\u06cc\u0631 \u0631\u0627 \u0628\u0632\u0646\u06cc\u062f:<\/p>\n<pre><code>\\q\r\n<\/code><\/pre>\n<p>\u0628\u0631\u0627\u06cc \u0648\u0631\u0648\u062f \u0628\u0647 postgres shell \u0628\u0627 \u06a9\u0627\u0631\u0628\u0631 fish_user \u0627\u0628\u062a\u062f\u0627 \u0628\u0627\u06cc\u062f \u0647\u0645\u0627\u0646 \u06a9\u0627\u0631\u0628\u0631 \u0631\u0627 \u0631\u0648\u06cc \u0627\u0648\u0628\u0648\u0646\u062a\u0648 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>sudo adduser fish_user\r\n<\/code><\/pre>\n<h2>\u0627\u06cc\u062c\u0627\u062f \u062c\u062f\u0648\u0644 shark \u062f\u0631 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 fish<\/h2>\n<p>\u0648\u0627\u0631\u062f \u0645\u062d\u06cc\u0637 \u067e\u0633\u062a\u06af\u0631\u0633 \u0628\u0627 \u06a9\u0627\u0631\u0628\u0631 fish_user \u0634\u0648\u06cc\u062f \u0648 \u0628\u0647 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 fish \u0645\u062a\u0635\u0644 \u0634\u0648\u06cc\u062f:<\/p>\n<pre><code>sudo -u fish_user psql -d fish\r\n<\/code><\/pre>\n<p>\u0628\u0631\u0627\u06cc \u0645\u0634\u0627\u0647\u062f\u0647 \u0627\u062a\u0635\u0627\u0644 \u0641\u0639\u0644\u06cc \u062f\u0633\u062a\u0648\u0631 \u0632\u06cc\u0631 \u0631\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>\\conninfo\r\n<\/code><\/pre>\n<p>\u0627\u06a9\u0646\u0648\u0646 \u062c\u062f\u0648\u0644 shark \u0631\u0627 \u0628\u0627 \u0633\u0647 \u0633\u062a\u0648\u0646 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>CREATE TABLE shark (\r\n  id SERIAL PRIMARY KEY,\r\n  name VARCHAR(50) NOT NULL,\r\n  color VARCHAR(50) NOT NULL\r\n);\r\n<\/code><\/pre>\n<p>\u0628\u0631\u0627\u06cc \u0645\u0634\u0627\u0647\u062f\u0647 \u062c\u062f\u0627\u0648\u0644 \u0645\u0648\u062c\u0648\u062f \u0627\u0632 \u062f\u0633\u062a\u0648\u0631 \u0632\u06cc\u0631 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>\\dt\r\n<\/code><\/pre>\n<p>\u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u062f:<\/p>\n<pre><code>\\q\r\n<\/code><\/pre>\n<h2>\u0627\u062a\u0635\u0627\u0644 Node.js \u0628\u0647 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 \u0628\u0627 node-postgres<\/h2>\n<p>\u0641\u0627\u06cc\u0644 <code>db.js<\/code> \u0631\u0627 \u0628\u0627 \u0648\u06cc\u0631\u0627\u06cc\u0634\u06af\u0631 \u0645\u062a\u0646 \u062f\u0644\u062e\u0648\u0627\u0647 \u0628\u0627\u0632 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>nano db.js\r\n<\/code><\/pre>\n<p>\u06a9\u062f \u0632\u06cc\u0631 \u0631\u0627 \u062f\u0631 <code>db.js<\/code> \u0627\u0636\u0627\u0641\u0647 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>const { Pool } = require('pg');\r\n\r\nconst pool = new Pool({\r\n  user: 'fish_user',\r\n  host: 'localhost',\r\n  database: 'fish',\r\n  password: 'strongpassword',\r\n  port: 5432,\r\n});\r\n\r\nmodule.exports = pool;\r\n<\/code><\/pre>\n<p>\u062d\u0641\u0638 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u062d\u0633\u0627\u0633 \u062f\u0631 \u0645\u062d\u06cc\u0637 \u062a\u0648\u0644\u06cc\u062f \u0628\u0647\u062a\u0631 \u0627\u0633\u062a \u0627\u0632 \u0637\u0631\u06cc\u0642 \u0641\u0627\u06cc\u0644\u200c\u0647\u0627\u06cc .env \u0627\u0646\u062c\u0627\u0645 \u0634\u0648\u062f \u06a9\u0647 \u062f\u0631 \u06af\u06cc\u062a \u062b\u0628\u062a \u0646\u0634\u0648\u0646\u062f.<\/p>\n<h2>\u062f\u0631\u062c \u062f\u0627\u062f\u0647 \u062f\u0631 \u062c\u062f\u0648\u0644 shark<\/h2>\n<p>\u0641\u0627\u06cc\u0644 <code>insertData.js<\/code> \u0631\u0627 \u0627\u06cc\u062c\u0627\u062f \u0648 \u0628\u0627\u0632 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>nano insertData.js\r\n<\/code><\/pre>\n<p>\u06a9\u062f \u0632\u06cc\u0631 \u0631\u0627 \u0642\u0631\u0627\u0631 \u062f\u0647\u06cc\u062f:<\/p>\n<pre><code>const pool = require('.\/db');\r\n\r\nasync function insertData() {\r\n  try {\r\n    const [name, color] = process.argv.slice(2);\r\n    await pool.query('INSERT INTO shark (name, color) VALUES ($1, $2)', [name, color]);\r\n    console.log(`Inserted ${name} with color ${color} successfully`);\r\n  } catch (err) {\r\n    console.error(err);\r\n  }\r\n}\r\n\r\ninsertData();\r\n<\/code><\/pre>\n<p>\u062d\u0627\u0644\u0627 \u062f\u0633\u062a\u0648\u0631 \u0632\u06cc\u0631 \u0631\u0627 \u0628\u0631\u0627\u06cc \u0648\u0631\u0648\u062f \u062f\u0627\u062f\u0647 \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>node insertData.js sammy blue\r\n<\/code><\/pre>\n<p>\u067e\u06cc\u0627\u0645 \u0645\u0648\u0641\u0642\u06cc\u062a \u0646\u0645\u0627\u06cc\u0634 \u062f\u0627\u062f\u0647 \u0648 \u0631\u06a9\u0648\u0631\u062f \u062f\u0631\u062c \u0645\u06cc\u200c\u0634\u0648\u062f. \u0645\u062c\u062f\u062f\u0627\u064b \u0628\u0627 \u0645\u0642\u0627\u062f\u06cc\u0631 \u0645\u062a\u0641\u0627\u0648\u062a \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>node insertData.js jose teal\r\n<\/code><\/pre>\n<h2>\u0628\u0627\u0632\u06cc\u0627\u0628\u06cc \u062f\u0627\u062f\u0647\u200c\u0647\u0627<\/h2>\n<p>\u0641\u0627\u06cc\u0644 <code>retrieveData.js<\/code> \u0628\u0633\u0627\u0632\u06cc\u062f \u0648 \u06a9\u062f \u0632\u06cc\u0631 \u0631\u0627 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>const pool = require('.\/db');\r\n\r\nasync function retrieveData() {\r\n  try {\r\n    const res = await pool.query('SELECT * FROM shark');\r\n    console.log(res.rows);\r\n  } catch (err) {\r\n    console.error(err);\r\n  }\r\n}\r\n\r\nretrieveData();\r\n<\/code><\/pre>\n<p>\u0628\u0631\u0627\u06cc \u0645\u0634\u0627\u0647\u062f\u0647 \u062f\u0627\u062f\u0647\u200c\u0647\u0627 \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>node retrieveData.js\r\n<\/code><\/pre>\n<h2>\u0628\u0647\u200c\u0631\u0648\u0632\u0631\u0633\u0627\u0646\u06cc \u0631\u06a9\u0648\u0631\u062f\u0647\u0627<\/h2>\n<p>\u0641\u0627\u06cc\u0644 <code>modifyData.js<\/code> \u0631\u0627 \u0628\u0633\u0627\u0632\u06cc\u062f \u0648 \u06a9\u062f \u0632\u06cc\u0631 \u0631\u0627 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>const pool = require('.\/db');\r\n\r\nasync function modifyData() {\r\n  try {\r\n    const [id, name] = process.argv.slice(2);\r\n    await pool.query('UPDATE shark SET name = $1 WHERE id = $2', [name, id]);\r\n    console.log(`Updated record id ${id} with new name ${name}`);\r\n  } catch (err) {\r\n    console.error(err);\r\n  }\r\n}\r\n\r\nmodifyData();\r\n<\/code><\/pre>\n<p>\u0628\u0631\u0627\u06cc \u062a\u063a\u06cc\u06cc\u0631 \u0646\u0627\u0645 \u0631\u06a9\u0648\u0631\u062f \u0628\u0627 id=2 \u062f\u0633\u062a\u0648\u0631 \u0632\u06cc\u0631 \u0631\u0627 \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>node modifyData.js 2 san\r\n<\/code><\/pre>\n<p>\u0648 \u0628\u0631\u0627\u06cc \u0627\u0637\u0645\u06cc\u0646\u0627\u0646 \u0627\u0632 \u062a\u063a\u06cc\u06cc\u0631\u060c \u062f\u0627\u062f\u0647\u200c\u0647\u0627 \u0631\u0627 \u062f\u0648\u0628\u0627\u0631\u0647 \u0628\u0627\u0632\u06cc\u0627\u0628\u06cc \u06a9\u0646\u06cc\u062f:<\/p>\n<pre><code>node retrieveData.js\r\n<\/code><\/pre>\n<h2>\u062c\u0645\u0639\u200c\u0628\u0646\u062f\u06cc<\/h2>\n<p>\u062f\u0631 \u0627\u06cc\u0646 \u0622\u0645\u0648\u0632\u0634\u060c \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 node-postgres \u06cc\u06a9 \u0628\u0631\u0646\u0627\u0645\u0647 Node.js \u0628\u0647 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 PostgreSQL \u0645\u062a\u0635\u0644 \u0634\u062f\u0647 \u0648 \u0639\u0645\u0644\u06cc\u0627\u062a \u062f\u0631\u062c\u060c \u0628\u0627\u0632\u06cc\u0627\u0628\u06cc \u0648 \u0648\u06cc\u0631\u0627\u06cc\u0634 \u062f\u0627\u062f\u0647\u200c \u0631\u0627 \u0627\u0646\u062c\u0627\u0645 \u062f\u0627\u062f\u06cc\u062f. \u0627\u0628\u062a\u062f\u0627 \u06a9\u0627\u0631\u0628\u0631 \u0648 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 \u062c\u062f\u06cc\u062f \u0631\u0627 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0631\u062f\u06cc\u062f\u060c \u0633\u067e\u0633 \u062c\u062f\u0648\u0644 \u0633\u0627\u062e\u062a\u06cc\u062f \u0648 \u062f\u0631 \u0646\u0647\u0627\u06cc\u062a \u0628\u0627 \u06a9\u062f\u0647\u0627\u06cc\u06cc \u0633\u0627\u062f\u0647 \u062f\u0627\u062f\u0647\u200c\u0647\u0627 \u0631\u0627 \u0645\u062f\u06cc\u0631\u06cc\u062a \u0646\u0645\u0648\u062f\u06cc\u062f.<\/p>\n<p>\u0628\u0631\u0627\u06cc \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0628\u06cc\u0634\u062a\u0631 \u0628\u0647 \u0645\u0633\u062a\u0646\u062f\u0627\u062a node-postgres \u062f\u0631 \u0648\u0628\u200c\u0633\u0627\u06cc\u062a \u0631\u0633\u0645\u06cc \u0645\u0631\u0627\u062c\u0639\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\n<p>\u0627\u0632 \u0647\u0645\u0631\u0627\u0647\u06cc \u0634\u0645\u0627 \u0628\u0627 \u062c\u0627\u0645\u0639\u0647 \u0622\u0645\u0648\u0632\u0634 <a href=\"https:\/\/parmin.cloud\/\"><strong>\u067e\u0627\u0631\u0645\u06cc\u0646 \u06a9\u0644\u0648\u062f<\/strong><\/a> \u0633\u067e\u0627\u0633\u06af\u0632\u0627\u0631\u06cc\u0645.<\/p>\n<div style='text-align:center' class='yasr-auto-insert-visitor'><\/div>","protected":false},"excerpt":{"rendered":"<p>\u0627\u06a9\u0648\u0633\u06cc\u0633\u062a\u0645 Node.js \u0645\u062c\u0645\u0648\u0639\u0647\u200c\u0627\u06cc \u0627\u0632 \u0627\u0628\u0632\u0627\u0631\u0647\u0627 \u0628\u0631\u0627\u06cc \u0627\u0631\u062a\u0628\u0627\u0637 \u0628\u0627 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647\u200c\u0647\u0627 \u0641\u0631\u0627\u0647\u0645 \u0645\u06cc\u200c\u06a9\u0646\u062f. \u06cc\u06a9\u06cc \u0627\u0632 \u0627\u06cc\u0646 \u0627\u0628\u0632\u0627\u0631\u0647\u0627 node-postgres \u0627\u0633\u062a \u06a9\u0647 \u0634\u0627\u0645\u0644 \u0645\u0627\u0698\u0648\u0644\u200c\u0647\u0627\u06cc\u06cc \u0628\u0631\u0627\u06cc \u0627\u0631\u062a\u0628\u0627\u0637 Node.js \u0628\u0627 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 PostgreSQL \u0645\u06cc\u200c\u0628\u0627\u0634\u062f. \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 node-postgres \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0647\u0627\u06cc\u06cc \u0628\u0646\u0648\u06cc\u0633\u06cc\u062f \u06a9\u0647 \u0627\u0645\u06a9\u0627\u0646 \u062f\u0633\u062a\u0631\u0633\u06cc \u0628\u0647 \u062f\u0627\u062f\u0647\u200c\u0647\u0627 \u0648 \u0630\u062e\u06cc\u0631\u0647 \u0622\u0646\u0647\u0627 \u062f\u0631 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 PostgreSQL \u0631\u0627 \u0641\u0631\u0627\u0647\u0645 \u0645\u06cc\u200c\u0622\u0648\u0631\u0646\u062f. \u062f\u0631 \u0627\u06cc\u0646 \u0622\u0645\u0648\u0632\u0634\u060c \u0634\u0645\u0627 [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":5743,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"yasr_overall_rating":0,"yasr_post_is_review":"","yasr_auto_insert_disabled":"","yasr_review_type":"","footnotes":""},"categories":[190,67,376],"tags":[595,597,598,599,596],"class_list":["post-5681","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming","category-67","category-376","tag--node-postgres---","tag-------node-js","tag------postgresql--","tag--node-js--postgresql--node-postgres","tag--crud--node-js--postgresql"],"aioseo_notices":[],"yasr_visitor_votes":{"stars_attributes":{"read_only":false,"span_bottom":false},"number_of_votes":0,"sum_votes":0},"_links":{"self":[{"href":"https:\/\/parmin.cloud\/blog\/wp-json\/wp\/v2\/posts\/5681","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/parmin.cloud\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/parmin.cloud\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/parmin.cloud\/blog\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/parmin.cloud\/blog\/wp-json\/wp\/v2\/comments?post=5681"}],"version-history":[{"count":4,"href":"https:\/\/parmin.cloud\/blog\/wp-json\/wp\/v2\/posts\/5681\/revisions"}],"predecessor-version":[{"id":5688,"href":"https:\/\/parmin.cloud\/blog\/wp-json\/wp\/v2\/posts\/5681\/revisions\/5688"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/parmin.cloud\/blog\/wp-json\/wp\/v2\/media\/5743"}],"wp:attachment":[{"href":"https:\/\/parmin.cloud\/blog\/wp-json\/wp\/v2\/media?parent=5681"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/parmin.cloud\/blog\/wp-json\/wp\/v2\/categories?post=5681"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/parmin.cloud\/blog\/wp-json\/wp\/v2\/tags?post=5681"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}