Skip to content

[Bug]: Autoentities not respecting schemas #3452

@Robert-IGS

Description

@Robert-IGS

For all schemas that are not "dbo" the autoentities config returns an error saying it cannot obtain the schema for the entity upon starting.

Example error message for a table with the schema name "Application" and table name "SystemTransactions":
"Cannot obtain Schema for entity Application_SystemTransactions with underlying database object source: dbo.SystemTransactions due to: Invalid object name 'dbo.SystemTransactions'"

Image

Using config:

{
  "$schema": "https://github.com/Azure/data-api-builder/releases/download/vmajor.minor.patch/dab.draft.schema.json",
  "data-source": {
    "database-type": "mssql",
    "connection-string": "XXXXXXXXXXX",
    "options": {
      "set-session-context": false
    }
  },
  "runtime": {
    "rest": {
      "enabled": true,
      "path": "/api",
      "request-body-strict": false
    },
    "graphql": {
      "enabled": true,
      "path": "/graphql",
      "allow-introspection": true
    },
    "mcp": {
      "enabled": true,
      "path": "/mcp"
    },
    "host": {
      "cors": {
        "origins": [],
        "allow-credentials": false
      },
      "authentication": {
        "provider": "Unauthenticated"
      },
      "mode": "production"
    },
    "telemetry": {
      "open-telemetry": {
        "enabled": true,
        "endpoint": "@env('OTEL_EXPORTER_OTLP_ENDPOINT')",
        "headers": "@env('OTEL_EXPORTER_OTLP_HEADERS')",
        "service-name": "@env('OTEL_SERVICE_NAME')"
      }
    }
  },
  "autoentities": {
    "everything": {
      "patterns": {
        "name": "{schema}_{object}"
      },
      "permissions": [
        { 
          "role": "anonymous", 
          "actions": [ { "action": "read" } ] 
        }
      ]
    }
  },
  "entities": {}
}

Version

2.0.0-rc

What database are you using?

Azure SQL

What hosting model are you using?

Local (including CLI)

Which API approach are you accessing DAB through?

GraphQL

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageissues to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions