Open
Description
function myguard(int $action, ...$args)
{
if ($action === SQLite3::READ) {
list($table, $column) = $args;
if ($table === 'users') {
return SQLite3::OK;
}
return SQLite3::IGNORE;
}
return SQLite3::DENY;
}
$db = new Clue\React\Sqlite\SqliteClient(':memory:');
$db->on('open', function () use ($db) {
$db->setAuthorizer('myguard');
});
$db->query('SELECT * FROM users')->then('var_dump');
See https://www.php.net/manual/en/sqlite3.setauthorizer.php (PHP 8+) and http://sqlite.org/c3ref/set_authorizer.html
Refs #47, #54, #58