19 lines
432 B
PHP
19 lines
432 B
PHP
<?php
|
|
namespace nulib\db\_private;
|
|
|
|
use nulib\cl;
|
|
use nulib\ValueException;
|
|
|
|
trait Tgeneric {
|
|
static function isa(string $sql): bool {
|
|
return preg_match('/^(?:drop\s+table)\b/i', $sql);
|
|
}
|
|
|
|
static function parse(array $query, ?array &$bindings=null): string {
|
|
if (!cl::is_list($query)) {
|
|
throw new ValueException("Seuls les tableaux séquentiels sont supportés");
|
|
}
|
|
return self::merge_seq($query);
|
|
}
|
|
}
|