{
  "scenarios": [
    {
      "type": "create",
      "name": "Create Role",
      "endpoint": "NODE-role.obj",
      "sql_endpoint": "NODE-role.sql_id",
      "msql_endpoint": "NODE-role.msql",
      "data": {
          "rolname": "Role1_$%{}[]()&*^!@\"'`\\/#",
          "rolcanlogin": false,
          "rolpassword": null,
          "rolconnlimit": -1,
          "rolsuper": false,
          "rolcreaterole": false,
          "rolcreatedb": false,
          "rolinherit": true,
          "rolcatupdate": false,
          "rolreplication": false,
          "rolmembership": [],
          "seclabels": [],
          "variables": []
      },
      "expected_sql_file": "create_role.sql",
      "expected_msql_file": "create_role.msql"
    },
    {
      "type": "alter",
      "name": "Alter Role description",
      "endpoint": "NODE-role.obj_id",
      "sql_endpoint": "NODE-role.sql_id",
      "msql_endpoint": "NODE-role.msql_id",
      "data": {
        "description": "This is detailed description"
      },
      "expected_sql_file": "alter_role_description.sql",
      "expected_msql_file": "create_role.msql"
    },
    {
      "type": "alter",
      "name": "Alter Role name",
      "endpoint": "NODE-role.obj_id",
      "sql_endpoint": "NODE-role.sql_id",
      "msql_endpoint": "NODE-role.msql_id",
      "data": {
        "rolname": "Role2_$%{}[]()&*^!@\"'`\\/#"
      },
      "expected_sql_file": "alter_role_name.sql",
      "expected_msql_file": "create_role.msql"
    },
    {
      "type": "alter",
      "name": "Alter Role options",
      "endpoint": "NODE-role.obj_id",
      "sql_endpoint": "NODE-role.sql_id",
      "msql_endpoint": "NODE-role.msql_id",
      "data": {
        "rolsuper": true,
        "rolcreatedb": true,
        "rolreplication": false,
        "rolpassword": "abc123",
        "rolconnlimit": 100,
        "rolvaliduntil": "2050-01-01 00:00:00 +05:30",
        "variables": { "added": [{"name":"application_name","value":"pg4","database":"postgres"}] }
      },
      "expected_sql_file": "alter_role_options.sql",
      "expected_msql_file": "create_role.msql"
    },
    {
      "type": "delete",
      "name": "Drop Role",
      "endpoint": "NODE-role.obj_id",
      "data": {}
    },
    {
      "type": "create",
      "name": "Create Login Role",
      "endpoint": "NODE-role.obj",
      "sql_endpoint": "NODE-role.sql_id",
      "msql_endpoint": "NODE-role.msql",
      "data": {
          "rolname": "Role1_$%{}[]()&*^!@\"'`\\/#",
          "rolcanlogin": true,
          "rolpassword": null,
          "rolconnlimit": -1,
          "rolsuper": true,
          "rolcreaterole": true,
          "rolcreatedb": true,
          "rolinherit": true,
          "rolcatupdate": true,
          "rolreplication": true,
          "rolmembership": [],
          "seclabels": [],
          "variables": []
      },
      "expected_sql_file": "create_login_role.sql",
      "expected_msql_file": "create_role.msql"
    },
    {
      "type": "alter",
      "name": "Alter Login Role description",
      "endpoint": "NODE-role.obj_id",
      "sql_endpoint": "NODE-role.sql_id",
      "msql_endpoint": "NODE-role.msql_id",
      "data": {
        "description": "This is detailed description"
      },
      "expected_sql_file": "alter_login_role_description.sql",
      "expected_msql_file": "create_role.msql"
    },
    {
      "type": "alter",
      "name": "Alter Login Role name",
      "endpoint": "NODE-role.obj_id",
      "sql_endpoint": "NODE-role.sql_id",
      "msql_endpoint": "NODE-role.msql_id",
      "data": {
        "rolname": "Role2_$%{}[]()&*^!@\"'`\\/#"
      },
      "expected_sql_file": "alter_login_role_name.sql",
      "expected_msql_file": "create_role.msql"
    },
    {
      "type": "alter",
      "name": "Alter Login Role options",
      "endpoint": "NODE-role.obj_id",
      "sql_endpoint": "NODE-role.sql_id",
      "msql_endpoint": "NODE-role.msql_id",
      "data": {
        "rolsuper": false,
        "rolcreatedb": false,
        "rolreplication": false,
        "rolpassword": "abc123",
        "rolconnlimit": 100,
        "rolvaliduntil": "2050-01-01 00:00:00 +05:30",
        "variables": { "added": [{"name":"application_name","value":"pg4","database":"postgres"}] }
      },
      "expected_sql_file": "alter_login_role_options.sql",
      "expected_msql_file": "create_role.msql"
    },
    {
      "type": "delete",
      "name": "Drop Login Role",
      "endpoint": "NODE-role.obj_id",
      "data": {}
    }
  ]
}
