-
-
Notifications
You must be signed in to change notification settings - Fork 157
Open
Labels
Description
Tempest version
3.0
PHP version
8.5
Operating system
macOS
Description
Most (when not all) Postgresql queries are not valid. They are all build with Mysqls `` (single backtick) quote character. But Postgres quote character is ".
Adding a quote and wrapInQuotes method to DatabaseDialect enum could help building valid SQL for the future:
public function quote(): string
{
return match ($this) {
self::POSTGRESQL => '"',
self::MYSQL, self::SQLITE => '`',
default => UnkownQuoteException(),
};
}
public function wrapInQuotes(string $value): string
{
$quote = $this->quote();
return sprintf('%s%s%s', $quote, $value, $quote);
}Reactions are currently unavailable