-
-
Notifications
You must be signed in to change notification settings - Fork 10
Support to issue initial queries #67
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
Comments
(I have to admit that TIL that setting the journal mode to WAL is a persistent setting. So the initial query I imagined I needed, is not needed anymore. But still, would like to discuss how one would issue initial queries using this wonderful library :).) |
Hey @hvt, thank you for taking the time and bringing in your ideas to improve this project 👍 There's actually an open feature request for this in #27. In there @clue described how a future $db = new Clue\React\Sqlite\SqliteClient('users.db');
$db->on('open', fn () => $db->exec('PRAGMA foreign_keys = on'));
$db->query('SELECT 1')->then(fn (QueryResult $result) => var_dump($result)); At the moment, we don't have any specific plans for when this will go live and as a result, I'm unable to provide you with an estimated timeline for its introduction in this project. @clue and I are working on a lot of different open source projects with the focus on ReactPHP and Framework X, so we'll keep you posted once we find the time to look into this 👍 If you need this urgently, you can also reach out to us or help us by becoming as sponsor ❤️ |
Hey @SimonFrings, sorry I did not find the feature request #27, but that was indeed exactly what I need. I'm good for now, did some ugly facading, so I just wait for the next good release to arrive. Bon boyage on all the ReactPHP & Framework X stuff 👍 |
Hey there, neat idea to make DB access async by using UNIX sockets and a separate process.
I was wondering about something in regard to this. I'm using the
LazyDatabase
primitive, to minimize opening the database when nothing is actually queried.In regard to SQLite, most of the times I'm using the WAL mode. But I find it a hassle to bother a user of the
DatabaseInterface
to always issue thePRAGMA journal_mode=wal
query first, before querying anything else.So is there any other way to enable the WAL mode? Is it perhaps possible to adapt the
journal_mode
using any of the$flags
? (I could not find much information what flags are available.)If that's not the case, I guess emitting an
open
event when the connection was actually opened -- with theDatabaseInterface
instance as the event's first argument -- would really help.In that case one could:
The text was updated successfully, but these errors were encountered: