Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>pomGenCodeByMSSqlNew to Visual Studio Code? Get it now.
pomGenCodeByMSSql

pomGenCodeByMSSql

pommoq

|
5 installs
| (0) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

pomgencodebymssql README

  1. วิธีใช้ Ctrl+, เลือก setting connection database
  2. Ctrl+Shift+P เลือก command pom:get Schema database หรือสร้างเองตาม Format *.db.json (สามารถแก้ไข schema ได้ตามต้องการที่จะนำไปใช้ gen กับ *.templ)
  3. New file or Exsist file และ เลือกตำแหน่งที่ต้องการ
    • Ctrl+Shift+P เลือก command pom:Generate Template handlebar
      • เลือก schema file
      • เลือก *.templ ที่ต้องการ
        • (สามารถสร้างเองได้ตาม handlebar template) ดู help จาก link https://handlebarsjs.com/guide/

Features

  • สร้าง Code จาก Template และ ตัวแปร columns ที่ได้จาก schema database
    • โครงสร้าง data
      {
        "custom": "customText",
        "config": {
          "user": "sa",
          "password": "password",
          "server": "127.0.0.1\\sqlexpress",
          "database": "dbname",
          "encrypt": true,
          "trustServerCertificate": true
        },
        "cols": [
          {
            "schemaName": "dbo",
            "tableName": "test",
            "colName": "test_id",
            "dataType": "int",
            "maxLength": 4,
            "precision": 10,
            "scale": 0,
            "isIdentity": true,
            "isComputed": false,
            "isNullable": false,
            "Description": "รหัส"
          }, ...
        ],
        "dbType": {
          "text": {
            "dbType": "text ",
            "cType": "string",
            "jsType": "string"
          },
          "int": {
            "dbType": "int",
            "cType": "int",
            "jsType": "number"
          }, ...
        }
      }
      
  • สร้าง Custom function ไว้ใช้กับ Template ได้

Requirements

ถ้าลง Extension สำหรับแก้ไข JSON File แนะนำ

  • JSON Table Editor

Extension Settings

settings connection dataabse:

  "pomgencodebymssql.connections": [
    {
      "name":"",
      "user": "",
      "password": "",
      "database": "",
      "server": "",
      "encrypt":true,
      "trustServerCertificate":true
    }
  ]

Release Notes

1.0.5

add template group : gen หลายๆไฟล์ ในทีเดียว

  • *.group.json
    • ดูตัวอย่างใน ex.group.json

      {
        "base": "d:/temp/templates/grouptest",
        "templates": [
          {
            "name": "{{tableName}}.ex1.txt",
            "src": "pom_ex1.tmpl"
          },
          {
            "name": "/pom2/{{tableName}}.ex2.txt",
            "src": "pom_ex2.tmpl"
          }
        ]
      }
      
  • gen template ใน file ที่มีอยู่แล้ว
    • ตัวอย่าง ex.add_partail.group.json

      {
        "base": "d:/temp/templates/grouptest",
        "templates": [
          {
            "edit": true,
            "option": {
              "split": "// add partial",
              "replace": "down"
            },
            "name": "/pom2/{{tableName}}.ex2.txt",
            "src": "pom_add_partail.tmpl"
          }
        ]
      }
      

1.0.3

add setting template path : สามารถกำหนดที่เก็บ template ได้

1.0.1

ปรับตัวอย่าง pom_ex2 Fix bug

1.0.0

พร้อมใช้งาน พร้อมตัวอย่าง pom_ex1.templ custom-build-in-function นอกเหนือจาก handlebar pom_ex2.templ ตัวอย่าง สร้าง interface c#

Enjoy!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft