- WIP on Collation

This commit is contained in:
mcndave committed 2024-12-16 18:46:24 +00:00
1 parent b601939459
commit b5e96eb7e0
8 files changed
+61 -11

No files matched your search

+7 -3
View File
@@ -62,7 +62,7 @@ abstract class Sql {
}
};
}
public static function raw(string $sql) : object
{
return static::identifier($sql);
@@ -84,8 +84,12 @@ abstract class Sql {
return $value;
}
public static function parameter($value) : string
public static function collate(string $name) : string
{
if ( ! preg_match('/^[a-z0-9$_]+$/i',$name) ) {
throw new \InvalidArgumentException(sprintf("Given identifier '%s' should contains supported characters in function name (a-Z, 0-9, $ and _)", $name));
}
return static::raw(sprintf("COLLATE %s", $name));
}
}