@@ -25,7 +25,7 @@ so you can query your data without blocking your main application.
2525 and does not get in your way.
2626 Future or custom commands and events require no changes to be supported.
2727* ** Good test coverage** -
28- Comes with an automated tests suite and is regularly tested against actual SQLite databases in the wild.
28+ Comes with an automated test suite and is regularly tested against actual SQLite databases in the wild.
2929
3030** Table of contents**
3131
@@ -64,6 +64,10 @@ existing SQLite database file (or automatically create it on first run) and then
6464` INSERT ` a new record to the database:
6565
6666``` php
67+ <?php
68+
69+ require __DIR__ . '/vendor/autoload.php';
70+
6771$factory = new Clue\React\SQLite\Factory();
6872
6973$db = $factory->openLazy('users.db');
@@ -164,11 +168,11 @@ the underlying database is ready. Additionally, it will only keep this
164168underlying database in an "idle" state for 60s by default and will
165169automatically end the underlying database when it is no longer needed.
166170
167- From a consumer side this means that you can start sending queries to the
171+ From a consumer side, this means that you can start sending queries to the
168172database right away while the underlying database process may still be
169173outstanding. Because creating this underlying process may take some
170- time, it will enqueue all oustanding commands and will ensure that all
171- commands will be executed in correct order once the database is ready.
174+ time, it will enqueue all outstanding commands and will ensure that all
175+ commands will be executed in the correct order once the database is ready.
172176In other words, this "virtual" database behaves just like a "real"
173177database as described in the ` DatabaseInterface ` and frees you from
174178having to deal with its async resolution.
@@ -213,7 +217,7 @@ $db = $factory->openLazy('users.db', SQLITE3_OPEN_READONLY);
213217By default, this method will keep "idle" connection open for 60s and will
214218then end the underlying connection. The next request after an "idle"
215219connection ended will automatically create a new underlying connection.
216- This ensure you always get a "fresh" connection and as such should not be
220+ This ensures you always get a "fresh" connection and as such should not be
217221confused with a "keepalive" or "heartbeat" mechanism, as this will not
218222actively try to probe the connection. You can explicitly pass a custom
219223idle timeout value in seconds (or use a negative number to not apply a
@@ -355,7 +359,7 @@ The `close(): void` method can be used to
355359force-close the connection.
356360
357361Unlike the ` quit() ` method, this method will immediately force-close the
358- connection and reject all oustanding commands.
362+ connection and reject all outstanding commands.
359363
360364``` php
361365$db->close();
@@ -400,7 +404,7 @@ See also the [`close()`](#close) method.
400404
401405## Install
402406
403- The recommended way to install this library is [ through Composer] ( https://getcomposer.org ) .
407+ The recommended way to install this library is [ through Composer] ( https://getcomposer.org/ ) .
404408[ New to Composer?] ( https://getcomposer.org/doc/00-intro.md )
405409
406410This project follows [ SemVer] ( https://semver.org/ ) .
@@ -427,7 +431,7 @@ $ sudo apt install php-sqlite3
427431## Tests
428432
429433To run the test suite, you first need to clone this repo and then install all
430- dependencies [ through Composer] ( https://getcomposer.org ) :
434+ dependencies [ through Composer] ( https://getcomposer.org/ ) :
431435
432436``` bash
433437$ composer install
@@ -436,7 +440,7 @@ $ composer install
436440To run the test suite, go to the project root and run:
437441
438442``` bash
439- $ php vendor/bin/phpunit
443+ $ vendor/bin/phpunit
440444```
441445
442446## License
0 commit comments