not retrieving data from tables other that dbo schemas

Hello everyone,
I have an SQL database containing tables with different schemas (e.g., dbo.auth_group, dbo.auth_user, HR.Bank, HR.City, IN.Status, IN.Branch). When I try to retrieve data from this database in my Django project using the inspectdb command, it only creates models from tables with the dbo schema and ignores others.
Here’s an example of the SQL that isn’t working:
sql
CREATE TABLE [HR].[Contractinfo] (
[ID] [tinyint] IDENTITY(1,1) NOT NULL,
[Title] varchar NOT NULL,
[ContractDetails] varchar NOT NULL
);
When I remove the schema part (e.g., changing [HR].Contractinfo to just Contractinfo), the command works. However, I want to generate models for all tables across different schemas without needing to modify the table names.
Desired Result:
I would like the inspectdb command to generate models for all tables across different schemas without needing to manipulate the table names.

Welcome @rezamohamadlo !

There are two separate issues here.

The first is that the different database vendors use the term “schema” to refer to different “things”. For example, in MySQL, a “database” is a “schema”.

Quoting directly from https://dev.mysql.com/doc/refman/8.4/en/glossary.html

In MySQL, physically, a schema is synonymous with a database. You can substitute the keyword SCHEMA instead of DATABASE in MySQL SQL syntax, for example using CREATE SCHEMA instead of CREATE DATABASE .

On the other hand, PostgreSQL provides a different definition identifying a distinction between the two:

A schema is a namespace for SQL objects, which all reside in the same database. Each SQL object must reside in exactly one schema.

Then, there’s SQLite, which doesn’t support the concept of creating a database or schema in SQL.

As a result of this, and Django’s intent to remain as database-neutral as possible, Django’s support for any aspect of using database schemas as a management or organizational structure is extremely limited.

The second issue then is that MS SQL Server is not a database directly supported by Django. Support for SQL Server is provided by a third-party module, so any features desired would be the responsibility of the third party - not Django.

thanks for your response, so how do you suggest me troubleshoot my problem?
I did install “mssql-django” package.

If the issue is that inspectdb isn’t seeing tables in other schemas, then you need to investigate what facilities the database engine provides for supporting multiple schemas.

You could try using the --help parameter on the inspectdb command to see if it provides any useful information.

thank you sir, helped a lot.