❯ grpcurl -plaintext -d '{}' localhost:50051 komp_ac.table_definition.TableDefinition/GetProfileTree
{
  "profiles": [
    {
      "name": "default",
      "tables": [
        {
          "name": "ud_2025_test_table_no_linked"
        },
        {
          "name": "ud_2025_test_table"
        }
      ]
    },
    {
      "name": "new_profile",
      "tables": [
        {
          "name": "ud_2025_multi_dependent_table2",
          "dependsOn": [
            "ud_2025_linked_test_table2"
          ]
        },
        {
          "name": "ud_2025_multi_dependent_table",
          "dependsOn": [
            "ud_2025_linked_test_table2"
          ]
        },
        {
          "name": "ud_2025_linked_test_table2",
          "dependsOn": [
            "ud_2025_profile_table"
          ]
        },
        {
          "name": "2025_multi_dependent_table3",
          "dependsOn": [
            "ud_2025_multi_dependent_table2"
          ]
        },
        {
          "name": "ud_2025_linked_test_table3",
          "dependsOn": [
            "ud_2025_profile_table"
          ]
        },
        {
          "name": "2025_multi_dependent_table4",
          "dependsOn": [
            "2025_multi_dependent_table3"
          ]
        },
        {
          "name": "ud_2025_linked_test_table",
          "dependsOn": [
            "ud_2025_profile_table"
          ]
        },
        {
          "name": "ud_2025_profile_table"
        }
      ]
    }
  ]
}
❯ grpcurl -plaintext -d '{
  "table_name": "multi_dependent_table5",
  "columns": [
    {"name": "column1", "data_type": "TEXT"},
    {"name": "columnx", "data_type": "TEXT"},
    {"name": "columny", "data_type": "TEXT"},
    {"name": "columnz", "data_type": "TEXT"},
    {"name": "columna", "data_type": "TEXT"},
    {"name": "columnb", "data_type": "TEXT"},
    {"name": "columnc", "data_type": "TEXT"},
    {"name": "columnd", "data_type": "TEXT"},
    {"name": "column2", "data_type": "INTEGER"}
  ],
  "indexes": ["column1", "columnd"],
  "profile_name": "new_profile",
  "linked_table_name": "2025_multi_dependent_table3"
}' localhost:50051 komp_ac.table_definition.TableDefinition/PostTableDefinition
{
  "success": true,
  "sql": "CREATE TABLE \"2025_multi_dependent_table5\" (\n    id BIGSERIAL PRIMARY KEY,\n    deleted BOOLEAN NOT NULL DEFAULT FALSE,\n    firma TEXT NOT NULL,\n    \"multi_dependent_table3_id\" BIGINT NOT NULL REFERENCES \"2025_multi_dependent_table3\"(id),\n    \"2025_column1\" TEXT,\n    \"2025_columnx\" TEXT,\n    \"2025_columny\" TEXT,\n    \"2025_columnz\" TEXT,\n    \"2025_columna\" TEXT,\n    \"2025_columnb\" TEXT,\n    \"2025_columnc\" TEXT,\n    \"2025_columnd\" TEXT,\n    \"2025_column2\" INTEGER,\n    created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP\n)\nCREATE INDEX idx_2025_multi_dependent_table5_firma ON \"2025_multi_dependent_table5\" (firma)\nCREATE INDEX idx_2025_multi_dependent_table5_multi_dependent_table3_id ON \"2025_multi_dependent_table5\" (\"multi_dependent_table3_id\")\nCREATE INDEX idx_2025_multi_dependent_table5_2025_column1 ON \"2025_multi_dependent_table5\" (\"2025_column1\")\nCREATE INDEX idx_2025_multi_dependent_table5_2025_columnd ON \"2025_multi_dependent_table5\" (\"2025_columnd\")"
}
❯ grpcurl -plaintext -d '{}' localhost:50051 komp_ac.table_definition.TableDefinition/GetProfileTree
{
  "profiles": [
    {
      "name": "default",
      "tables": [
        {
          "name": "ud_2025_test_table_no_linked"
        },
        {
          "name": "ud_2025_test_table"
        }
      ]
    },
    {
      "name": "new_profile",
      "tables": [
        {
          "name": "ud_2025_linked_test_table",
          "dependsOn": [
            "ud_2025_profile_table"
          ]
        },
        {
          "name": "ud_2025_multi_dependent_table2",
          "dependsOn": [
            "ud_2025_linked_test_table2"
          ]
        },
        {
          "name": "2025_multi_dependent_table3",
          "dependsOn": [
            "ud_2025_multi_dependent_table2"
          ]
        },
        {
          "name": "ud_2025_profile_table"
        },
        {
          "name": "ud_2025_linked_test_table3",
          "dependsOn": [
            "ud_2025_profile_table"
          ]
        },
        {
          "name": "2025_multi_dependent_table4",
          "dependsOn": [
            "2025_multi_dependent_table3"
          ]
        },
        {
          "name": "2025_multi_dependent_table5",
          "dependsOn": [
            "2025_multi_dependent_table3"
          ]
        },
        {
          "name": "ud_2025_multi_dependent_table",
          "dependsOn": [
            "ud_2025_linked_test_table2"
          ]
        },
        {
          "name": "ud_2025_linked_test_table2",
          "dependsOn": [
            "ud_2025_profile_table"
          ]
        }
      ]
    }
  ]
}
