modifs.mineures sans commentaires

This commit is contained in:
Jephté Clain 2025-06-05 15:38:06 +04:00
parent 8fcf865bf0
commit 0d47b2a757
2 changed files with 16 additions and 16 deletions

View File

@ -227,6 +227,22 @@ abstract class CapacitorStorage {
"class_name" => "varchar", "class_name" => "varchar",
]; ];
function channelExists(string $name, ?array &$row=null): bool {
$row = $this->db()->one([
"select",
"from" => static::CHANNELS_TABLE,
"where" => ["name" => $name],
]);
return $row !== null;
}
function getChannels(): iterable {
return $this->db()->all([
"select",
"from" => static::CHANNELS_TABLE,
]);
}
protected function _createChannelsSql(): array { protected function _createChannelsSql(): array {
return [ return [
"create table if not exists", "create table if not exists",

View File

@ -38,22 +38,6 @@ class SqliteStorage extends CapacitorStorage {
return new _sqliteMigration($migrations, $channel->getName()); return new _sqliteMigration($migrations, $channel->getName());
} }
function channelExists(string $name, ?array &$row=null): bool {
$row = $this->db->one([
"select",
"from" => static::CHANNELS_TABLE,
"where" => ["name" => $name],
]);
return $row !== null;
}
function getChannels(): iterable {
return $this->db->all([
"select",
"from" => static::CHANNELS_TABLE,
]);
}
protected function _addToChannelsSql(CapacitorChannel $channel): array { protected function _addToChannelsSql(CapacitorChannel $channel): array {
$sql = parent::_addToChannelsSql($channel); $sql = parent::_addToChannelsSql($channel);
$sql[0] = "insert or ignore"; $sql[0] = "insert or ignore";