From 4906bd093ce61fbf033957805820f23e4a683135 Mon Sep 17 00:00:00 2001 From: ChiragAgg5k Date: Fri, 17 Jan 2025 16:54:45 +0530 Subject: [PATCH] chore: fixed and improved readme --- README.md | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 1232df477..db7ea5866 100644 --- a/README.md +++ b/README.md @@ -48,13 +48,13 @@ The database document interface only supports primitives types (`strings`, `inte Below is a list of supported databases, and their compatibly tested versions alongside a list of supported features and relevant limits. -| Adapter | Status | Version | -|---------|---------|---| -| MariaDB | ✅ | 10.5 | -| MySQL | ✅ | 8.0 | -| Postgres | ✅ | 13.0 | -| MongoDB | ✅ | 5.0 | -| SQLlite | ✅ | 3.38 | +| Adapter | Status | Version | +| -------- | ------ | ------- | +| MariaDB | ✅ | 10.5 | +| MySQL | ✅ | 8.0 | +| Postgres | ✅ | 13.0 | +| MongoDB | ✅ | 5.0 | +| SQLite | ✅ | 3.38 | ` ✅ - supported ` @@ -200,7 +200,7 @@ $pdoConfig = [ PDO::ATTR_STRINGIFY_FETCHES => true, ]; -$pdo = new PDO("{$dbPath}", $pdoConfig); +$pdo = new PDO("sqlite:{$dbPath}", $pdoConfig); $cache = new Cache(new Memory()); // or use any cache adapter you wish @@ -228,7 +228,7 @@ $mongoClient = new Client($dbName, $dbHost, $dbPort, $dbUser, $dbPass, true); $cache = new Cache(new Memory()); // or use any cache adapter you wish -$database = new Database(new Mongo($client), $cache); +$database = new Database(new Mongo($mongoClient), $cache); ``` ### Database Methods @@ -293,7 +293,6 @@ Database::EVENT_DOCUMENT_CREATE, Database::EVENT_DOCUMENT_UPDATE, Database::EVENT_DOCUMENT_READ, Database::EVENT_DOCUMENT_FIND, -Database::EVENT_DOCUMENT_FIND, Database::EVENT_DOCUMENT_COUNT, Database::EVENT_DOCUMENT_SUM, Database::EVENT_DOCUMENT_INCREASE, @@ -667,7 +666,7 @@ Role::members( Permission::read(Role::any()), Permission::create(Role::user(ID::unique())), Permission::update(Role::user(ID::unique(padding: 23))), -Permission::delete(Role::user(ID::custom(id: 'my_user_3235')) +Permission::delete(Role::user(ID::custom(id: 'my_user_3235'))) // To create a document $document = new Document([ @@ -794,7 +793,7 @@ $database->find( collection: 'movies', queries: [ Query::equal(attribute: 'name', values: ['Captain Marvel']), - Query::notEqual(attribute: 'year', values: [2019]) + Query::notEqual(attribute: 'year', value: 2019) ], timeout: 1 //timeout is optional ); @@ -850,7 +849,7 @@ Utopia Framework requires PHP 8.0 or later. We recommend using the latest PHP ve ## Contributing Thank you for considering contributing to the Utopia Framework! -Checkout the [CONTRIBUTING.md](https://github.com/utopia-php/database/blob/main/CONTRIBUTING.md) file for more information. +Check out the [CONTRIBUTING.md](https://github.com/utopia-php/database/blob/main/CONTRIBUTING.md) file for more information. ## Copyright and License