Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Summaries error in MSSQL Environment #12583

Closed
CruxAllez opened this issue May 2, 2024 · 1 comment
Closed

Summaries error in MSSQL Environment #12583

CruxAllez opened this issue May 2, 2024 · 1 comment
Milestone

Comments

@CruxAllez
Copy link
Contributor

Package

filament/filament

Package Version

v3.2.62

Laravel Version

v11.2.0

Livewire Version

No response

PHP Version

8.3.6

Problem description

When I am using the summaries feature from table builder in mssql with a complex table name it generate a select query that has a invalid as for the subquery it uses the table name but points are not allowed in the as

The Problem is for examble in Summirzer.php

$query = DB::connection($query->getModel()->getConnectionName())
    ->table($query->toBase(), $query->getModel()->getTable());

Expected behavior

The subquery should generate valid aliases for tables, even in MSSQL environments with complex schema names.

Steps to reproduce

Create a model with a complex schema name
Use table builder with summarization in MSSQL environment.

TextColumn::make('EFK_VERKAUFSWERT_NETTO')
                    ->summarize(Sum::make())

Observe the error due to invalid table aliases in the generated subquery's AS clause.

Reproduction repository

https://github.com/CruxAllez/filament-issue-mssql

Relevant log output

No response

@CruxAllez CruxAllez added bug Something isn't working low priority unconfirmed labels May 2, 2024
@CruxAllez CruxAllez changed the title Summaries Error in MSSQL Environment Summaries error in MSSQL Environment May 2, 2024
@danharrin
Copy link
Member

I am not a user of this driver, so I would appreciate you investigating the issue and opening a PR if you can, I don't know if any of the Filament team are going to take active action on this bug report so I don't want you to be left waiting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

3 participants