Files
ops-Gazelle/app/Pg.php
2025-05-23 14:41:16 +02:00

22 lines
477 B
PHP

<?php
namespace Gazelle;
trait Pg {
protected static \Gazelle\DB\Pg $pgro; // R/O access
protected static \Gazelle\DB\Pg $pg; // R/W access
public function pgro(): DB\Pg {
return self::$pgro ??= new DB\Pg(PG_RO_DSN);
}
public function pg(): DB\Pg {
return self::pgStatic();
}
// disgusting hack required for \View class
public static function pgStatic(): DB\Pg {
return self::$pg ??= new DB\Pg(PG_RW_DSN);
}
}