-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mathis Burger
committed
Sep 26, 2022
1 parent
45deda3
commit ea0ebc2
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# SurrealDb.php | ||
|
||
SurrealDb.php is a driver written in php for the surrealDb database. It supports some | ||
basic features that can be used to perform actions on the database. | ||
It uses the websocket API of the database. | ||
|
||
# Installation | ||
|
||
Installation is quite easy with | ||
```shell | ||
composer require mathisburger/surrealdb | ||
``` | ||
|
||
# Usage | ||
|
||
Just require the package via composer and follow the following guide how to create | ||
a new entry in the database: | ||
|
||
```php | ||
|
||
// Only needed for plain PHP scripts that do not use a framework like symfony | ||
include './vendor/autoload.php'; | ||
|
||
use MathisBurger\SurrealDb\SurrealDriver; | ||
|
||
$conn = new SurrealDriver('ws://127.0.0.1:8000/rpc'); | ||
$conn->login('root', 'root'); | ||
$conn->useDatabase('test', 'test'); | ||
$conn->create('user', ['username' => 'Mathis', 'password' => 'Test']); | ||
``` | ||
|
||
# License | ||
|
||
This project is MIT licensed. |