-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add setAuthorizer to Pdo\Sqlite #17321
Comments
If I remember correctly, the only hurdle to also have this for PDO_Sqlite was indeed the lack of driver specific subclasses. Since that has changed, I think this is a reasonbable feature request. PR welcome! |
For some context, I had a use case where setting the authorizer would be helpful in a package I maintain. For now I went with bundling compiled dll/so/dylib files with the composer package. This feature would simplify that a lot. Also, one thing I was trying to do before resorting to bundling compiled libraries with my package was seeing if I could use FFI to achieve this. I'm not sure if this is something you'd want, but imo it'd be very helpful if Then you could just use FFI to do these things at the application level. libsqlite3 has pretty simple headers so I think it's a good fit for FFI. One way to do this now is to load a SQLite extension which creates a function that returns the pointer as a u64, which then lets you do whatever you want using FFI, but the downside is you still need the actual compiled extension to create the function. |
Description
Since we now have separate classes for different PDO types, could we get
Pdo\Sqlite::setAuthorizer()
?The SQLite3 extension supports it: https://www.php.net/manual/en/sqlite3.setauthorizer.php
The C interface is pretty straightforward: https://www.sqlite.org/c3ref/set_authorizer.html, you get the action as an int, some string parameters, and return one of these values:
The SQLite3 extension's
setAuthorizer()
has a bool return type so I'm assuming it'sSQLITE_OK
andSQLITE_DENY
, sinceSQLITE_IGNORE
probably has pretty niche use cases.The text was updated successfully, but these errors were encountered: