Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ipranjal committed Oct 11, 2024
2 parents 1523a0d + bd1da18 commit 7671b31
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 5 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
name: Tests
on: [push, pull_request,workflow_dispatch]
jobs:
router-tests:
arca-tests:
runs-on: ubuntu-latest
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['8. 3']
php-versions: ['8.3']
phpunit-versions: ['latest']
include:
- operating-system: 'ubuntu-latest'
php-versions: '8.3'
services:
mysql:
image: mysql:latest
env:
MYSQL_DATABASE: test_database
MYSQL_HOST: 127.0.0.1
MYSQL_USER: admin
MYSQL_PASSWORD: rootpass
MYSQL_ROOT_PASSWORD: rootpass
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
Expand Down
46 changes: 44 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,44 @@
# database
Arca ORM integration bridge for scrawler router
<div align="center">
<h1>Scrawler Database </h1>
<a href="https://github.com/scrawler-labs/database/actions/workflows/main.yml"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/scrawler-labs/database/main.yml?style=flat-square"></a>&nbsp;
<a href="https://app.codecov.io/gh/scrawler-labs/database"><img alt="Codecov" src="https://img.shields.io/codecov/c/github/scrawler-labs/arca-orm?style=flat-square"></a>&nbsp;
<a href="https://github.com/scrawler-labs/arca-orm/actions/workflows/main.yml"><img src="https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat-square" alt="PHPStan Enabled"></a>
<img alt="Packagist Version (including pre-releases)" src="https://img.shields.io/packagist/v/scrawler/arca?include_prereleases&style=flat-square">&nbsp;
<img alt="GitHub License" src="https://img.shields.io/github/license/scrawler-labs/arca-orm?color=blue&style=flat-square">
<br><br>
🔥Wrapper around <a href= "https://github.com/scrawler-labs/arca-orm">Arca ORM</a> to be integrated with scrawler framework 🔥<br>
🇮🇳 Made in India 🇮🇳
<br><br>
</div>

## 💻 Installation
You can install Scrawler App via Composer. If you don't have composer installed , you can download composer from [here](https://getcomposer.org/download/)

```sh
composer require scrawler/database
```


## ✨ Basic usage
Repo of Arca Orm: <a href= "https://github.com/scrawler-labs/arca-orm">https://github.com/scrawler-labs/arca-orm</a>

```php
<?php

require __DIR__ . '/vendor/autoload.php';

$connectionParams = array(
'dbname' => 'YOUR_DB_NAME',
'user' => 'YOUR_DB_USER',
'password' => 'YOUR_DB_PASSWORD',
'host' => 'YOUR_DB_HOST',
'driver' => 'pdo_mysql', //You can use other supported driver this is the most basic mysql driver
);

db()->connect($connectionParams);

$user = db()->create('user');
$user->name = 'test user';
$user->age = 12;
$user->save();
```

0 comments on commit 7671b31

Please # to comment.