@@ -57,8 +57,9 @@ class Configuration
|
||||
if (empty($dsn)) {
|
||||
self::$mode = self::$pdoDSN = Option::None();
|
||||
} else {
|
||||
self::$mode = Option::Some(Mode::deriveFromDSN($dsn));
|
||||
self::$pdoDSN = Option::Some($dsn);
|
||||
self::$mode = Mode::deriveFromDSN($dsn)
|
||||
|> Option::Some(...);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ class Field
|
||||
*
|
||||
* @param array<string, mixed> $existing The existing parameters
|
||||
* @return array<string, mixed> The given parameter array with this field's name and value(s) appended
|
||||
* @throws Exception If the database mode has not been set
|
||||
*/
|
||||
public function appendParameter(array $existing): array
|
||||
{
|
||||
@@ -121,6 +122,33 @@ class Field
|
||||
: $fieldPath . ' ' . $this->op->toSQL() . $criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a qualifier for the field, returning the modified field
|
||||
*
|
||||
* @param string $qualifier The table qualifier to use for the field
|
||||
* @return Field The field instance with the qualifier set
|
||||
*/
|
||||
public function andQualifier(string $qualifier): Field
|
||||
{
|
||||
$this->qualifier = $qualifier;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new `Field` instance based on the given field, using the qualifier provided
|
||||
*
|
||||
* @param string $qualifier The table qualifier to use for the field
|
||||
* @return callable<Field, Field> A new `Field` instance with the qualifier set
|
||||
*/
|
||||
public static function withQualifier(string $qualifier): callable
|
||||
{
|
||||
return function (Field $field) use ($qualifier) {
|
||||
return clone($field, [
|
||||
"qualifier" => $qualifier
|
||||
]);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Create parameter names for an IN clause
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user