Feature request: Schemas

Hello! The tool is great, really like it. A colleague of mine recommended it.
It would be great if it supports multiple schemas not only the public one. For example some of the tables may be in a security shchema: security.users, security.authorities, etc; some may be in raw: raw.device_data, raw.logs, etc; and so on.

Regards,
Anatoliy

1 Like

Hello @tolya, I’m Bong from dbdiagram team. Thanks for your feedback!
We will add this in our roadmap and once done, you can simply define as:

Table security.users {
    name varchar
    id int [pk]
}

And when defining relationships, to keep it simple you must define an alias for the table in the schema:

Table security.users as s_user {
    name varchar
    id int [pk]
}
Table account {
    created_at timestamp
    id int
}
Ref: s_user.id > account.id

Just a side note: MySQL doesn’t support schema so please be aware :smiley:

1 Like

Is there any progress on this? Without allowing a schema to be added, the PG export scripts are not really usable. Or, is there some workaround for this?

And after adding schema support to the DBML language there should also be implemented optional filters by schemas (multi-select) in dbdiagram.io

currently schema.name doesn’t work, I have to use "schema.name"

Thanks, with the quotes I managed to get a working import. I still had to remove the quotes from the table names with scripts (actually an excel sheet) but after that I could import with schema

Update May 2022: This feature has been developed and released. Please see below for the official announcement.