{
  "db_name": "PostgreSQL",
  "query": "\n            INSERT INTO company_profiles (\n                user_id, company_name, registration_number, industry, website_url, \n                employee_count, business_type, gst_number, contact_name, \n                contact_email, contact_phone, address_line1, city, state, postal_code, status\n            )\n            VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, 'PENDING')\n            ON CONFLICT (user_id) DO UPDATE SET\n                company_name = EXCLUDED.company_name,\n                registration_number = EXCLUDED.registration_number,\n                industry = EXCLUDED.industry,\n                website_url = EXCLUDED.website_url,\n                employee_count = EXCLUDED.employee_count,\n                business_type = EXCLUDED.business_type,\n                gst_number = EXCLUDED.gst_number,\n                contact_name = EXCLUDED.contact_name,\n                contact_email = EXCLUDED.contact_email,\n                contact_phone = EXCLUDED.contact_phone,\n                address_line1 = EXCLUDED.address_line1,\n                city = EXCLUDED.city,\n                state = EXCLUDED.state,\n                postal_code = EXCLUDED.postal_code,\n                status = CASE\n                    WHEN company_profiles.status = 'APPROVED' THEN 'APPROVED'\n                    ELSE 'PENDING'\n                END,\n                updated_at = NOW()\n            RETURNING \n                id, user_id, company_name, registration_number, industry, \n                website_url, employee_count, business_type, gst_number,\n                contact_name, contact_email, contact_phone, address_line1,\n                city, state, country, postal_code, status,\n                free_job_slots, purchased_job_slots, free_contact_views, purchased_contact_views,\n                created_at, updated_at\n            ",
  "describe": {
    "columns": [
      {
        "ordinal": 0,
        "name": "id",
        "type_info": "Uuid"
      },
      {
        "ordinal": 1,
        "name": "user_id",
        "type_info": "Uuid"
      },
      {
        "ordinal": 2,
        "name": "company_name",
        "type_info": "Varchar"
      },
      {
        "ordinal": 3,
        "name": "registration_number",
        "type_info": "Varchar"
      },
      {
        "ordinal": 4,
        "name": "industry",
        "type_info": "Varchar"
      },
      {
        "ordinal": 5,
        "name": "website_url",
        "type_info": "Varchar"
      },
      {
        "ordinal": 6,
        "name": "employee_count",
        "type_info": "Int4"
      },
      {
        "ordinal": 7,
        "name": "business_type",
        "type_info": "Varchar"
      },
      {
        "ordinal": 8,
        "name": "gst_number",
        "type_info": "Varchar"
      },
      {
        "ordinal": 9,
        "name": "contact_name",
        "type_info": "Varchar"
      },
      {
        "ordinal": 10,
        "name": "contact_email",
        "type_info": "Varchar"
      },
      {
        "ordinal": 11,
        "name": "contact_phone",
        "type_info": "Varchar"
      },
      {
        "ordinal": 12,
        "name": "address_line1",
        "type_info": "Varchar"
      },
      {
        "ordinal": 13,
        "name": "city",
        "type_info": "Varchar"
      },
      {
        "ordinal": 14,
        "name": "state",
        "type_info": "Varchar"
      },
      {
        "ordinal": 15,
        "name": "country",
        "type_info": "Varchar"
      },
      {
        "ordinal": 16,
        "name": "postal_code",
        "type_info": "Varchar"
      },
      {
        "ordinal": 17,
        "name": "status",
        "type_info": "Varchar"
      },
      {
        "ordinal": 18,
        "name": "free_job_slots",
        "type_info": "Int4"
      },
      {
        "ordinal": 19,
        "name": "purchased_job_slots",
        "type_info": "Int4"
      },
      {
        "ordinal": 20,
        "name": "free_contact_views",
        "type_info": "Int4"
      },
      {
        "ordinal": 21,
        "name": "purchased_contact_views",
        "type_info": "Int4"
      },
      {
        "ordinal": 22,
        "name": "created_at",
        "type_info": "Timestamptz"
      },
      {
        "ordinal": 23,
        "name": "updated_at",
        "type_info": "Timestamptz"
      }
    ],
    "parameters": {
      "Left": [
        "Uuid",
        "Varchar",
        "Varchar",
        "Varchar",
        "Varchar",
        "Int4",
        "Varchar",
        "Varchar",
        "Varchar",
        "Varchar",
        "Varchar",
        "Varchar",
        "Varchar",
        "Varchar",
        "Varchar"
      ]
    },
    "nullable": [
      false,
      false,
      false,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      false,
      true,
      false,
      false,
      false,
      false,
      false,
      false,
      false
    ]
  },
  "hash": "4801d44e6152aacafb688b6dacb65accdf79b6e13101c1f3189fb8d09033aae2"
}
