{
  "meta": {
    "options": {
      "linkedFile": "/views/index0.ejs",
      "linkedForm": "serverconnectform1"
    },
    "$_POST": [
      {
        "type": "text",
        "fieldName": "db_fullName",
        "name": "db_fullName"
      },
      {
        "type": "text",
        "fieldName": "db_licenseNumber",
        "name": "db_licenseNumber"
      },
      {
        "type": "number",
        "fieldName": "db_employeeID",
        "options": {
          "rules": {
            "core:number": {}
          }
        },
        "name": "db_employeeID"
      },
      {
        "type": "text",
        "fieldName": "owner",
        "name": "owner"
      },
      {
        "type": "text",
        "fieldName": "db_stateIssue",
        "name": "db_stateIssue"
      },
      {
        "type": "text",
        "fieldName": "db_trainerID",
        "name": "db_trainerID"
      }
    ]
  },
  "exec": {
    "steps": [
      {
        "name": "validate",
        "module": "validator",
        "action": "validate",
        "options": {
          "data": [
            {
              "name": "validate_1",
              "value": "{{$_POST.db_licenseNumber}}",
              "rules": {
                "db:notexists": {
                  "param": {
                    "connection": "DB",
                    "table": "da",
                    "column": "db_licenseNumber"
                  },
                  "message": "Already in database. Delete record then retry."
                }
              },
              "fieldName": "db_licenseNumber"
            }
          ]
        }
      },
      {
        "name": "insert",
        "module": "dbupdater",
        "action": "insert",
        "options": {
          "connection": "DB",
          "sql": {
            "type": "insert",
            "values": [
              {
                "table": "da",
                "column": "db_fullName",
                "type": "text",
                "value": "{{$_POST.db_fullName}}",
                "recid": 1
              },
              {
                "table": "da",
                "column": "db_licenseNumber",
                "type": "text",
                "value": "{{$_POST.db_licenseNumber}}",
                "recid": 2
              },
              {
                "table": "da",
                "column": "db_stateIssue",
                "type": "text",
                "value": "{{$_POST.db_stateIssue}}",
                "recid": 3
              },
              {
                "table": "da",
                "column": "db_employeeID",
                "type": "number",
                "value": "{{$_POST.db_employeeID}}",
                "recid": 4
              },
              {
                "table": "da",
                "column": "owner",
                "type": "text",
                "value": "{{$_POST.owner}}",
                "recid": 5
              }
            ],
            "table": "da",
            "returning": "ID",
            "query": "insert into `da` (`db_employeeID`, `db_fullName`, `db_licenseNumber`, `db_stateIssue`, `owner`) values (?, ?, ?, ?, ?) returning `ID`",
            "params": [
              {
                "name": ":P1",
                "type": "expression",
                "value": "{{$_POST.db_fullName}}",
                "test": ""
              },
              {
                "name": ":P2",
                "type": "expression",
                "value": "{{$_POST.db_licenseNumber}}",
                "test": ""
              },
              {
                "name": ":P3",
                "type": "expression",
                "value": "{{$_POST.db_stateIssue}}",
                "test": ""
              },
              {
                "name": ":P4",
                "type": "expression",
                "value": "{{$_POST.db_employeeID}}",
                "test": ""
              },
              {
                "name": ":P5",
                "type": "expression",
                "value": "{{$_POST.owner}}",
                "test": ""
              }
            ]
          }
        },
        "meta": [
          {
            "name": "identity",
            "type": "text"
          },
          {
            "name": "affected",
            "type": "number"
          }
        ],
        "output": true
      }
    ]
  }
}