Skip to content

The table alias is currently forced to lowercase, which limits flexibility. #162

Description

@mean-cj

Hello

Would it be possible to remove this restriction force table alias to strtolower() ?

$this->statements['aliases'][$table] = \strtolower($alias);

$t = sprintf('%s AS %s', $table, strtolower($prefix));

return sprintf('%s AS %s', $this->wrapSanitizer($table), $this->wrapSanitizer(strtolower($this->aliasPrefix)));

An example where forcing aliases to be lowercase makes it unusable.

DB::table(['service_type_ssl' => 'tableS'])
  ->select([
    'O.OrderID',
    'O.CustomerID',
    'O.ServiceName',

    'tableS.ServiceStatus',
    'tableS.OrderName',
  ])
  ->leftJoin(['service_order', 'O'], 'O.OrderID', '=', 'tableS.OrderID')
  ->first()

Thank you.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions