multiSchema does not work with SQL Server schemas with dot in name (= databases)
See original GitHub issueBug description
In sqlserver when declaring several schemas, it was not possible to perform a select. There was a table not found error in the database
How to reproduce
(https://github.com/prisma/prisma/issues/15077#issuecomment-1270280714)
Expected behavior
No response
Prisma information
Its work
datasource db {
provider = "sqlserver"
url = env("DATABASE_URL")
schemas = ["database1].[dbo", "database2].[dbo"]
}
Does not work
datasource db {
provider = "sqlserver"
url = env("DATABASE_URL")
schemas = ["database1", "database2"]
}
prismaClient.table1.findMany()
Environment & setup
- OS: Windows
- Database: SQL Server
- Node.js version: v16.14.0
Prisma Version
v4.4.0
Issue Analytics
- State:
- Created a year ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Is it okay to put dots in SQL Server database names?
However choosing a database that contains a dot will produce an error stating that the server could not be found. It seems that...
Read more >Entity Framework and multiple schemas - Stack Overflow
I'm trying to set up my dbContext so that it can handle multiple schemas in a single Oracle database.
Read more >"Invalid object name" when trying to read tables from multi ...
In FME Workbench I have a MS SQLServer database that has multiple schemas. Schema1.Schema2.Tablename. Workbench sees the tables in the ...
Read more >Import table failed when schema name contains dot character ...
If the table is not in the current database the name must be qualified ... when schema name contains dot character with Microsoft...
Read more >Documentation: 15: 5.9. Schemas - PostgreSQL
Unlike databases, schemas are not rigidly separated: a user can access objects in ... name consisting of the schema name and table name...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, that makes sense. You “hacked” our system 👍 😆
I fear we will probably have to limit that first, before we can properly enable this. Right now the foreign keys are a important requirement for a relation in Prisma. We will open that up sooner or later, and then that would also enable doing
multiDatabase
for SQL Server with databases on the same server.Naturally this breaks in every engine. Here’s what introspection engine gives us:
We do not support multi-database schemas with any database. But, you should try out Prisma 4.8.0 tomorrow that does let you to migrate and introspect multi-schema databases with SQL Server.