hoyvoy / laravel-cross-database-subqueries

Eloquent cross database compatibility in subqueries
MIT License
102 stars 43 forks source link

Not working with SQL Server #22

Open Healyhatman opened 3 years ago

Healyhatman commented 3 years ago

Description:

Trying to perform a cross-database whereHas The generated SQL looks like this: (SQL: select top 1 * from [Clients] where exists (select * from [TMACentral-Demo].[Cli_Core] where [Clients].[CLIENTNUM] = [Cli_Core].[SYSID])

When it should be [TMACentral-Demo].[dbo].[Cli_Core]

Healyhatman commented 3 years ago

In QueriesRelationships if I add a ".dbo" like this $queryFrom = $hasQuery->getConnection()->getTablePrefix().'<-->'.$hasQuery->getQuery()->from.'<-->'.$subqueryConnection.".dbo"; then it works but still investigating what I would need to do to make it actually work dynamically so I can do a pull request