[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"academy-blogs-th-1-1-all-js2go-ep44-database-connection-sql-nosql-javascript-go-all--*":3,"academy-blog-translations-80o1aimylbrt97t":86},{"data":4,"page":85,"perPage":85,"totalItems":85,"totalPages":85},[5],{"alt":6,"collectionId":7,"collectionName":8,"content":9,"cover_image":10,"cover_image_path":11,"created":12,"created_by":13,"expand":14,"id":80,"keywords":81,"locale":54,"published_at":82,"scheduled_at":13,"school_blog":76,"short_description":83,"status":74,"title":6,"updated":84,"updated_by":13,"slug":77,"views":79},"JS2GO EP.44 การเชื่อมต่อ Database: SQL & NoSQL ใน JavaScript และ Go","sclblg987654321","school_blog_translations","\u003Cp>การเชื่อมต่อฐานข้อมูล (Database Connection) คือหัวใจของ Backend ทุกระบบ ไม่ว่าจะเป็น API, Microservices, Real-time Server หรือระบบ Enterprise\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>ใน EP.44 นี้ เราจะสรุปอย่างครบเครื่อง:\u003C\u002Fp>\u003Cp>Databases ที่ครอบคลุม\u003C\u002Fp>\u003Cul>\u003Cli>PostgreSQL\u003C\u002Fli>\u003Cli>MySQL\u003C\u002Fli>\u003Cli>MongoDB (NoSQL)\u003C\u002Fli>\u003Cli>Redis (In-memory \u002F Cache)\u003C\u002Fli>\u003C\u002Ful>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>ภาษา &amp; Framework ที่ใช้\u003C\u002Fp>\u003Cul>\u003Cli>Node.js (Express)\u003C\u002Fli>\u003Cli>Go (Fiber)\u003C\u002Fli>\u003C\u002Ful>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>สิ่งสำคัญระดับ Production\u003C\u002Fp>\u003Cul>\u003Cli>Connection Pooling\u003C\u002Fli>\u003Cli>ORM \u002F Query Builder ที่ควรใช้\u003C\u002Fli>\u003Cli>Timeout \u002F Retry \u002F Circuit Breaker\u003C\u002Fli>\u003Cli>การป้องกัน Connection Leak\u003C\u002Fli>\u003Cli>Health Check และ Monitoring\u003C\u002Fli>\u003C\u002Ful>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>บทความนี้ถูกออกแบบมาให้ อ่านง่าย พร้อมใช้จริงใน Production ไม่ใช่แค่โค้ดตัวอย่าง แต่เป็น “แนวทางที่ใช้จริงในโปรเจกต์ใหญ่”\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch2>⭐ 1) การเชื่อมต่อ SQL Database (PostgreSQL \u002F MySQL)\u003C\u002Fh2>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>ฐานข้อมูล SQL เป็นแกนหลักของระบบส่วนใหญ่ โดย PostgreSQL และ MySQL คือสองตัวเลือกยอดนิยมที่สุด\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>🟦 Go (Fiber) → PostgreSQL ด้วย pgx (แนะนำที่สุด)\u003C\u002Fh3>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>\u003Ccode inline=\"\">pgx\u003C\u002Fcode> คือ PostgreSQL driver ที่เร็วสุดใน Go รองรับ connection pooling, cancellation, timeout และ statement cache ในตัว\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>➤ Connect Database\u003C\u002Fh3>\u003Cpre>\u003Ccode class=\"language-plaintext language-go\">import (\n\t\"context\"\n\t\"github.com\u002Fjackc\u002Fpgx\u002Fv5\u002Fpgxpool\"\n\t\"log\"\n)\n\nvar DB *pgxpool.Pool\n\nfunc ConnectDB() {\n\tconnStr := \"postgres:\u002F\u002Fuser:password@localhost:5432\u002Fmydb\"\n\n\tpool, err := pgxpool.New(context.Background(), connStr)\n\tif err != nil {\n\t\tlog.Fatal(\"❌ Unable to connect to database:\", err)\n\t}\n\n\tDB = pool\n\tlog.Println(\"✅ Connected to PostgreSQL\")\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>➤ Query ใน Fiber Handler\u003C\u002Fh3>\u003Cpre>\u003Ccode class=\"language-plaintext language-go\">func GetUsers(c *fiber.Ctx) error {\n\trows, err := DB.Query(context.Background(), \"SELECT id, name FROM users\")\n\tif err != nil {\n\t\treturn c.Status(500).SendString(\"DB Error\")\n\t}\n\tdefer rows.Close()\n\n\tvar users []User\n\n\tfor rows.Next() {\n\t\tvar u User\n\t\tif err := rows.Scan(&amp;u.ID, &amp;u.Name); err != nil {\n\t\t\treturn c.Status(500).SendString(\"Scan error\")\n\t\t}\n\t\tusers = append(users, u)\n\t}\n\n\treturn c.JSON(users)\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>✔ จุดแข็งของ Go + pgx\u003C\u002Fh3>\u003Cul>\u003Cli>ความเร็วสูงสุดใน ecosystem Go\u003C\u002Fli>\u003Cli>ใช้ Memory ต่ำ\u003C\u002Fli>\u003Cli>รองรับ high concurrency\u003C\u002Fli>\u003Cli>Connection leak เกิดขึ้นยากหากใช้งานถูกต้อง\u003C\u002Fli>\u003C\u002Ful>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>🟧 Node.js (Express) → PostgreSQL ผ่าน pg\u003C\u002Fh3>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>ไลบรารีมาตรฐานที่ใช้งานได้ดี มี connection pool ในตัว\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>➤ Connect Database\u003C\u002Fh3>\u003Cpre>\u003Ccode class=\"language-plaintext language-js\">const { Pool } = require(\"pg\");\n\nconst pool = new Pool({\n  connectionString: \"postgres:\u002F\u002Fuser:password@localhost:5432\u002Fmydb\",\n});\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>➤ Query\u003C\u002Fh3>\u003Cpre>\u003Ccode class=\"language-plaintext language-js\">app.get(\"\u002Fusers\", async (req, res) =&gt; {\n  try {\n    const result = await pool.query(\"SELECT id, name FROM users\");\n    res.json(result.rows);\n  } catch (err) {\n    res.status(500).send(\"DB Error\");\n  }\n});\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch2>⭐ 2) เชื่อมต่อ MySQL\u003C\u002Fh2>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>🟦 Go → MySQL ด้วย go-sql-driver\u002Fmysql\u003C\u002Fh3>\u003Cpre>\u003Ccode class=\"language-plaintext language-go\">import \"database\u002Fsql\"\nimport _ \"github.com\u002Fgo-sql-driver\u002Fmysql\"\n\ndb, err := sql.Open(\"mysql\", \"user:password@tcp(localhost:3306)\u002Fmydb\")\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>🟧 Node.js → MySQL2 (แนะนำ)\u003C\u002Fh3>\u003Cpre>\u003Ccode class=\"language-plaintext language-js\">import mysql from \"mysql2\u002Fpromise\";\n\nconst pool = mysql.createPool({\n  host: \"localhost\",\n  user: \"root\",\n  database: \"mydb\",\n});\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch2>⭐ 3) เชื่อมต่อ MongoDB (NoSQL)\u003C\u002Fh2>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>เหมาะกับระบบที่ไม่ต้องการ schema ตายตัว หรือเก็บข้อมูลจำนวนมาก\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>🟦 Go → MongoDB (mongo-driver)\u003C\u002Fh3>\u003Cpre>\u003Ccode class=\"language-plaintext language-go\">client, err := mongo.Connect(context.Background(),\n  options.Client().ApplyURI(\"mongodb:\u002F\u002Flocalhost:27017\"),\n)\ncollection := client.Database(\"mydb\").Collection(\"users\")\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>🟧 Node.js → MongoDB ด้วย Mongoose (นิยมที่สุด)\u003C\u002Fh3>\u003Cpre>\u003Ccode class=\"language-plaintext language-js\">import mongoose from \"mongoose\";\n\nmongoose.connect(\"mongodb:\u002F\u002Flocalhost:27017\u002Fmydb\");\n\nconst User = mongoose.model(\"User\", new mongoose.Schema({\n  name: String\n}));\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch2>⭐ 4) เชื่อมต่อ Redis (Cache \u002F Queue \u002F PubSub \u002F Rate limit)\u003C\u002Fh2>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>🟦 Go → Redis (go-redis v9)\u003C\u002Fh3>\u003Cpre>\u003Ccode class=\"language-plaintext language-go\">import \"github.com\u002Fredis\u002Fgo-redis\u002Fv9\"\n\nrdb := redis.NewClient(&amp;redis.Options{\n  Addr: \"localhost:6379\",\n})\n\nrdb.Set(ctx, \"key\", \"value\", 0)\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>🟧 Node.js → Redis (ioredis)\u003C\u002Fh3>\u003Cpre>\u003Ccode class=\"language-plaintext language-js\">import Redis from \"ioredis\";\n\nconst redis = new Redis();\nawait redis.set(\"key\", \"value\");\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch2>⭐ 5) ORM \u002F Query Builder ที่ควรใช้ (Go \u002F JS)\u003C\u002Fh2>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>🟦 Go ORMs \u002F Query Builders\u003C\u002Fh3>\u003Cfigure class=\"table\">\u003Ctable>\u003Cthead>\u003Ctr>\u003Cth>Lib\u003C\u002Fth>\u003Cth>จุดเด่น\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\u003Ctbody>\u003Ctr>\u003Ctd>GORM\u003C\u002Ftd>\u003Ctd>ใช้ง่ายที่สุด อ่านง่าย\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>SQLC\u003C\u002Ftd>\u003Ctd>generate โค้ด compile-time type-safe\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>Ent\u003C\u002Ftd>\u003Ctd>schema-first ลด human error\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>pgx\u003C\u002Ftd>\u003Ctd>เร็วที่สุด เหมาะกับ raw query\u003C\u002Ftd>\u003C\u002Ftr>\u003C\u002Ftbody>\u003C\u002Ftable>\u003C\u002Ffigure>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>คำแนะนำ\u003C\u002Fp>\u003Cul>\u003Cli>เน้น performance → pgx\u003C\u002Fli>\u003Cli>เน้น type-safe → SQLC\u003C\u002Fli>\u003Cli>เน้นเขียนง่าย → GORM\u003C\u002Fli>\u003C\u002Ful>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>🟧 Node.js ORMs \u002F Query Builders\u003C\u002Fh3>\u003Cfigure class=\"table\">\u003Ctable>\u003Cthead>\u003Ctr>\u003Cth>Lib\u003C\u002Fth>\u003Cth>จุดเด่น\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\u003Ctbody>\u003Ctr>\u003Ctd>Prisma\u003C\u002Ftd>\u003Ctd>type-safe สุด ง่ายสุด\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>Sequelize\u003C\u002Ftd>\u003Ctd>ORM รุ่นคลาสสิก ใช้กันมานาน\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>TypeORM\u003C\u002Ftd>\u003Ctd>ดีมากใน NestJS\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>Knex.js\u003C\u002Ftd>\u003Ctd>Query Builder ที่เบาและลื่นสุด\u003C\u002Ftd>\u003C\u002Ftr>\u003C\u002Ftbody>\u003C\u002Ftable>\u003C\u002Ffigure>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>คำแนะนำ\u003C\u002Fp>\u003Cul>\u003Cli>เน้น type-safe → Prisma\u003C\u002Fli>\u003Cli>เน้น performance → Knex.js\u003C\u002Fli>\u003C\u002Ful>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch2>⭐ 6) Connection Pool เรื่องสำคัญที่สุด!\u003C\u002Fh2>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>🟦 Go → pgx pool config\u003C\u002Fh3>\u003Cpre>\u003Ccode class=\"language-plaintext language-go\">poolConfig, _ := pgxpool.ParseConfig(connStr)\npoolConfig.MaxConns = 20\npoolConfig.MinConns = 5\npoolConfig.MaxConnIdleTime = 30 * time.Second\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>🟧 Node.js → pg pool\u003C\u002Fh3>\u003Cpre>\u003Ccode class=\"language-plaintext language-js\">const pool = new Pool({\n  max: 20,\n  idleTimeoutMillis: 30000,\n  connectionTimeoutMillis: 2000,\n});\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>สิ่งที่พบบ่อยที่สุด และควรหลีกเลี่ยง\u003Cbr>❌ ห้ามเปิด connection ใหม่ทุกครั้งใน handler\u003Cbr>❌ ห้ามเก็บ connection pool ไว้ใน global ที่ scale ไม่ได้\u003Cbr>✔ ใช้ connection pool และ inject ให้ service ใช้แทน\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch2>⭐ 7) Best Practices สำหรับ Production\u003C\u002Fh2>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>✔ ตั้งค่า Timeout ทุก query\u003C\u002Fh3>\u003Cp>ป้องกัน query ค้าง (long-running query)\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>✔ เปิด Slow Query Logs\u003C\u002Fh3>\u003Cp>ช่วยจับ bottleneck\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>✔ ใช้ Retry + Circuit Breaker\u003C\u002Fh3>\u003Cp>ป้องกันระบบล้มแบบ domino effect\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>✔ Health Check \u003Ccode inline=\"\">\u002Fhealth\u002Fdb\u003C\u002Fcode>\u003C\u002Fh3>\u003Cp>เช่น \u003Ccode inline=\"\">SELECT 1\u003C\u002Fcode>\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>✔ แยก Write \u002F Read\u003C\u002Fh3>\u003Cp>เหมาะกับระบบที่มี traffic เยอะ เช่น e-commerce\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch3>✔ ใช้ Connection Pool อย่างมีสติ\u003C\u002Fh3>\u003Cp>ค่าสูงเกิน = DB overload\u003Cbr>ค่าต่ำเกิน = API ช้า\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Chr>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch2>📌 สรุป\u003C\u002Fh2>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>การเชื่อมต่อ Database เป็นทักษะสำคัญที่ JS Dev ต้องมี และ Go Dev ต้องเข้าใจลึก\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>หากตั้งค่าถูกต้อง คุณจะได้ระบบที่:\u003C\u002Fp>\u003Cp>🚀 เร็ว\u003Cbr>🧱 เสถียร\u003Cbr>🔐 ปลอดภัย\u003Cbr>🌐 พร้อมใช้งาน Production\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>ทั้ง Node.js และ Go มี ecosystem ที่แข็งแรงมาก:\u003C\u002Fp>\u003Cp>➡ Node.js: pg, Prisma, ioredis\u003Cbr>➡ Go: pgx, SQLC, GORM, go-redis\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>เข้าใจเครื่องมือเหล่านี้ = คุณพัฒนาระบบได้ระดับมืออาชีพ\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Ch2>🔵 ตอนต่อไป EP.45 การจัดการ Transactions และ ACID ใน Go กับ JavaScript\u003C\u002Fh2>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>คุณจะได้เรียนรู้ทั้งรูปแบบ SQL Transaction + Business Transaction:\u003C\u002Fp>\u003Cp>✔ BEGIN \u002F COMMIT \u002F ROLLBACK\u003Cbr>✔ ACID Properties\u003Cbr>✔ Handling Deadlocks\u003Cbr>✔ Transaction Scopes\u003Cbr>✔ Go pgx\u002FGORM transaction pattern\u003Cbr>✔ Node.js PostgreSQL transaction flow\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>เตรียมพร้อมขึ้นสู่ระดับ Intermediate → Advanced 🌟\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cdiv class=\"raw-html-embed\">\u003Cdiv style=\"margin:0 0 6px 0; font-weight:700;\">อ่านบทความ Series อื่นๆ:\u003C\u002Fdiv>\n\u003Cul style=\"list-style:none; padding:0; margin:0; line-height:1.4;\">\n  \u003Cli style=\"margin:0;\">\u003Ca href=\"\u002Fblogs\u002Fcategories\u002FGolang\" title=\"Golang The Series\">Golang The Series\u003C\u002Fa>\u003C\u002Fli>\n  \u003Cli style=\"margin:0;\">\u003Ca href=\"\u002Fblogs\u002Fcategories\u002FJS2GO\" title=\"JS2GO\">JS2GO\u003C\u002Fa>\u003C\u002Fli>\n  \u003Cli style=\"margin:0;\">\u003Ca href=\"\u002Fblogs\u002Fcategories\u002FTailwind%20CSS\" title=\"10 Ep ที่จะให้คุณเป็นมือโปร Tailwind CSS ในชั่วข้ามคืน\">10 Ep ที่จะให้คุณเป็นมือโปร Tailwind CSS ในชั่วข้ามคืน\u003C\u002Fa>\u003C\u002Fli>\n\u003C\u002Ful>\u003C\u002Fdiv>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cdiv class=\"raw-html-embed\">\n  \u003Cp style=\"margin:0 0 6px 0;\">\u003Cstrong>Follow Us:\u003C\u002Fstrong>\u003C\u002Fp>\n  \u003Cul style=\"list-style:none; padding:0; margin:0; line-height: 0.4;\">\n    \u003Cli style=\"display:flex; align-items:center; gap:6px; margin:0;\">\n      \n      \u003Csvg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"#1877F2\" aria-hidden=\"true\">\n        \u003Cpath d=\"M22 12.07C22 6.48 17.52 2 11.93 2S2 6.48 2 12.07c0 5 3.66 9.14 8.44 9.93v-7.02H7.9v-2.91h2.54V9.41c0-2.5 1.49-3.88 3.77-3.88 1.09 0 2.24.2 2.24.2v2.46h-1.26c-1.24 0-1.63.77-1.63 1.56v1.87h2.78l-.44 2.91h-2.34V22c4.78-.79 8.44-4.93 8.44-9.93Z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Ca href=\"https:\u002F\u002Fwww.facebook.com\u002Fsuperdev.academy.th\" target=\"_blank\" rel=\"noopener\" title=\"Follow Superdev Academy on Facebook\">Facebook: Superdev Academy\u003C\u002Fa>\n    \u003C\u002Fli>\n\n    \u003Cli style=\"display:flex; align-items:center; gap:6px; margin:0;\">\n      \n      \u003Csvg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"#FF0000\" aria-hidden=\"true\">\n        \u003Cpath d=\"M23.5 6.2a3 3 0 0 0-2.1-2.1C19.5 3.5 12 3.5 12 3.5s-7.5 0-9.4.6A3 3 0 0 0 .5 6.2 31.5 31.5 0 0 0 0 12a31.5 31.5 0 0 0 .5 5.8 3 3 0 0 0 2.1 2.1c1.9.6 9.4.6 9.4.6s7.5 0 9.4-.6a3 3 0 0 0 2.1-2.1A31.5 31.5 0 0 0 24 12a31.5 31.5 0 0 0-.5-5.8ZM9.75 15.02V8.98L15.5 12l-5.75 3.02Z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Ca href=\"https:\u002F\u002Fwww.youtube.com\u002F@SuperdevAcademy\" target=\"_blank\" rel=\"noopener\" title=\"Watch on YouTube\">YouTube: Superdev Academy\u003C\u002Fa>\n    \u003C\u002Fli>\n\n    \u003Cli style=\"display:flex; align-items:center; gap:6px; margin:0;\">\n      \n      \u003Csvg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"#E4405F\" aria-hidden=\"true\">\n        \u003Cpath d=\"M7 2h10a5 5 0 0 1 5 5v10a5 5 0 0 1-5 5H7a5 5 0 0 1-5-5V7a5 5 0 0 1 5-5Zm10 2H7a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3Zm-5 3.5A5.5 5.5 0 1 1 6.5 13 5.5 5.5 0 0 1 12 7.5Zm0 2A3.5 3.5 0 1 0 15.5 13 3.5 3.5 0 0 0 12 9.5Zm5.75-2.75a1.25 1.25 0 1 1-1.25 1.25 1.25 1.25 0 0 1 1.25-1.25Z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Ca href=\"https:\u002F\u002Fwww.instagram.com\u002Fsuperdevacademy\u002F?hl=en target=\" _blank\"=\"\" rel=\"noopener\" title=\"See behind-the-scenes on Instagram\">Instagram: Superdev Academy\u003C\u002Fa>\n    \u003C\u002Fli>\n\n    \u003Cli style=\"display:flex; align-items:center; gap:6px; margin:0;\">\n      \n      \u003Csvg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"#000000\" aria-hidden=\"true\">\n        \u003Cpath d=\"M21 8.12a6.86 6.86 0 0 1-4.8-2V16a6 6 0 1 1-6-6 5.9 5.9 0 0 1 1.63.23V8.05a9.08 9.08 0 0 1-1.63-.15V4.5a6.86 6.86 0 0 0 4.8 2.05V6.5a6.86 6.86 0 0 0 4.8 1.62ZM9.2 12.5A3.5 3.5 0 1 0 12.7 16V9.94a6 6 0 0 1-1.63-.27v3.95a3.5 3.5 0 0 1-1.87 3.17 3.5 3.5 0 0 1-4.78-3.23 3.5 3.5 0 0 1 4.78-3.06Z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Ca href=\"https:\u002F\u002Fwww.tiktok.com\u002F@superdevacademy\" target=\"_blank\" rel=\"noopener\" title=\"Watch short tips on TikTok\">TikTok: @superdevacademy\u003C\u002Fa>\n    \u003C\u002Fli>\n\n    \u003Cli style=\"display:flex; align-items:center; gap:6px; margin:0;\">\n      \n      \u003Csvg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"#111827\" aria-hidden=\"true\">\n        \u003Cpath d=\"M12 2a10 10 0 1 0 10 10A10.01 10.01 0 0 0 12 2Zm6.93 6h-3.26a15.6 15.6 0 0 0-1.39-3.62A8.03 8.03 0 0 1 18.93 8ZM12 4c.73.93 1.7 2.74 2.2 4H9.8C10.3 6.74 11.27 4.93 12 4ZM8.72 4.38A15.6 15.6 0 0 0 7.32 8H4.07a8.03 8.03 0 0 1 4.65-3.62ZM4.07 16h3.25a15.6 15.6 0 0 0 1.4 3.62A8.03 8.03 0 0 1 4.07 16ZM12 20c-.73-.93-1.7-2.74-2.2-4h4.4C13.7 17.26 12.73 19.07 12 20Zm3.28-.38A15.6 15.6 0 0 0 16.68 16h3.25a8.03 8.03 0 0 1-4.65 3.62ZM20 14h-3.54a13.8 13.8 0 0 1-.26-4H20a7.98 7.98 0 0 1 0 4Zm-12.2 0H4a7.98 7.98 0 0 1 0-4h3.54a13.8 13.8 0 0 1-.26 4Zm2 .5h4.4a17.8 17.8 0 0 1-.72-4.5c0-1.58.25-3.1.72-4.5H9.8a17.8 17.8 0 0 1 .72 4.5c0 1.58-.25 3.1-.72 4.5Z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Ca href=\"https:\u002F\u002Fwww.superdevacademy.com\u002F\" target=\"_blank\" rel=\"noopener\" title=\"Visit the official website of Superdev Academy\">Official Website: Superdev Academy.com\u003C\u002Fa>\n    \u003C\u002Fli>\n  \u003C\u002Ful>\n\u003C\u002Fdiv>\u003Cp>&nbsp;\u003C\u002Fp>","cover_image_js2_go_ep_i85wxvw0ej.JavaScriptandGo.webp","https:\u002F\u002Ftwsme-r2.tumwebsme.com\u002Fsclblg987654321\u002Fy8ql3s3zg33thzx\u002Fcover_image_js2_go_ep_i85wxvw0ej.JavaScriptandGo.webp","2026-03-04 08:45:10.183Z","",{"keywords":15,"locale":48,"school_blog":58},[16,23,28,33,38,43],{"collectionId":17,"collectionName":18,"created":19,"created_by":13,"id":20,"name":21,"updated":22,"updated_by":13},"sclkey987654321","school_keywords","2026-03-04 08:24:40.405Z","05u3tysava2z6ga","Node.js","2026-04-10 16:07:29.504Z",{"collectionId":17,"collectionName":18,"created":24,"created_by":13,"id":25,"name":26,"updated":27,"updated_by":13},"2026-03-04 08:45:08.439Z","wscthqnz8vx2sox","PostgreSQL","2026-04-10 16:12:54.755Z",{"collectionId":17,"collectionName":18,"created":29,"created_by":13,"id":30,"name":31,"updated":32,"updated_by":13},"2026-03-04 08:20:42.484Z","vslzz9nvv6n77cx","JavaScript","2026-04-10 16:07:28.339Z",{"collectionId":17,"collectionName":18,"created":34,"created_by":13,"id":35,"name":36,"updated":37,"updated_by":13},"2026-03-04 08:45:09.036Z","l1oi3jpol4c4ezx","Database","2026-04-10 16:12:54.847Z",{"collectionId":17,"collectionName":18,"created":39,"created_by":13,"id":40,"name":41,"updated":42,"updated_by":13},"2026-03-04 08:20:11.547Z","ey3puyme01a9bsw","Go","2026-04-10 16:07:25.893Z",{"collectionId":17,"collectionName":18,"created":44,"created_by":13,"id":45,"name":46,"updated":47,"updated_by":13},"2026-03-04 08:45:09.799Z","402ofda7qxj0vs0","การเชื่อมต่อฐานข้อมูล","2026-04-10 16:12:55.032Z",{"code":49,"collectionId":50,"collectionName":51,"created":52,"flag":53,"id":54,"is_default":55,"label":56,"updated":57},"th","pbc_1989393366","locales","2026-01-22 10:59:55.832Z","twemoji:flag-thailand","s8wri3bt4vgg2ji",true,"Thai","2026-04-10 15:42:46.614Z",{"category":59,"collectionId":60,"collectionName":61,"created":13,"expand":62,"id":76,"slug":77,"updated":78,"views":79},"hsa1afr8fcnd6qb","pbc_2105096300","school_blogs",{"category":63},{"blogIds":64,"collectionId":65,"collectionName":66,"created":67,"created_by":13,"id":59,"image":68,"image_alt":13,"image_path":69,"label":70,"name":71,"priority":72,"publish_at":73,"scheduled_at":13,"status":74,"updated":75,"updated_by":13},[],"sclcatblg987654321","school_category_blogs","2026-03-04 08:24:37.986Z","js2_go_2_11zon_y6paxmuz32.webp","https:\u002F\u002Ftwsme-r2.tumwebsme.com\u002Fsclcatblg987654321\u002Fhsa1afr8fcnd6qb\u002Fjs2_go_2_11zon_y6paxmuz32.webp",{"en":71,"th":71},"JS2GO",10,"2025-08-11 03:41:08.820Z","published","2026-04-25 02:32:14.339Z","80o1aimylbrt97t","js2go-ep44-database-connection-sql-nosql-javascript-go","2026-05-09 16:26:51.129Z",219,"y8ql3s3zg33thzx",[20,25,30,35,40,45],"2025-12-08 07:51:54.211Z","สรุปวิธีเชื่อมต่อ PostgreSQL, MySQL, MongoDB และ Redis ใน JavaScript และ Go พร้อมตัวอย่างโค้ดจริง การตั้งค่า Connection Pool, การเลือก ORM\u002FQuery Builder และ Best Practices ที่ต้องรู้ก่อนขึ้นระบบ Production","2026-05-08 06:52:04.733Z",1,{"th":77,"en":77}]