Skip to content

Commit 545fa23

Browse files
authored
Merge pull request #1 from makise-co/feature/initial
Initial commit
2 parents 17e2f93 + 300b2f9 commit 545fa23

22 files changed

+3114
-1
lines changed

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.idea/
2+
.env
3+
.coveralls.yml
4+
composer.lock
5+
vendor/
6+
tests/runtime/*
7+
build/logs/*
8+
build/
9+
*.db
10+
clover.xml
11+
clover.json
12+
.php_cs.cache
13+
.phpunit.result.cache

README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,39 @@
11
# postgres-spiral-driver
2-
Makise PostgreSQL adapter for Spiral DBAL
2+
MakiseCo PostgreSQL client adapter for Spiral DBAL
3+
4+
WARNING: This driver could be used only in the Coroutine context
5+
6+
Usage:
7+
```php
8+
<?php
9+
10+
declare(strict_types=1);
11+
12+
use Spiral\Database;
13+
14+
$dbConfig = new Database\Config\DatabaseConfig([
15+
'default' => 'default',
16+
'databases' => [
17+
'default' => [
18+
'connection' => 'pgsql'
19+
]
20+
],
21+
'connections' => [
22+
'pgsql' => [
23+
'driver' => \MakiseCo\Database\Driver\MakisePostgres\MakisePostgresDriver::class,
24+
'options' => [
25+
'connection' => 'host=127.0.0.1;port=5432;dbname=makise',
26+
'username' => 'postgres',
27+
'password' => 'postgres',
28+
29+
// or specify config parts directly
30+
'host' => '127.0.0.1',
31+
'port' => 5432,
32+
'database' => 'makise',
33+
]
34+
]
35+
]
36+
]);
37+
38+
$dbal = new Database\DatabaseManager($dbConfig);
39+
```

composer.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "makise-co/postgres-spiral-driver",
3+
"type": "library",
4+
"description": "Makise-Co Postgres client adapter for Spiral DBAL",
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Dmitry K.",
9+
"email": "[email protected]"
10+
}
11+
],
12+
"require": {
13+
"php": "^7.4",
14+
"spiral/database": "~2.0",
15+
"makise-co/postgres": "~1.0.5"
16+
},
17+
"require-dev": {
18+
"mockery/mockery": "^1.1",
19+
"phpunit/phpunit": "~8.0",
20+
"swoole/ide-helper": "^4.5"
21+
},
22+
"autoload": {
23+
"psr-4": {
24+
"MakiseCo\\Database\\": "src/"
25+
}
26+
},
27+
"autoload-dev": {
28+
"psr-4": {
29+
"MakiseCo\\Database\\Tests\\": "tests/Database/"
30+
}
31+
}
32+
}

phpunit.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit bootstrap="tests/bootstrap.php"
3+
backupGlobals="false"
4+
backupStaticAttributes="false"
5+
colors="true"
6+
verbose="false"
7+
convertErrorsToExceptions="true"
8+
convertNoticesToExceptions="true"
9+
convertWarningsToExceptions="true"
10+
processIsolation="false"
11+
stopOnFailure="false"
12+
stopOnError="false">
13+
14+
<testsuites>
15+
<testsuite name="Spiral DBAL">
16+
<directory>./tests/</directory>
17+
</testsuite>
18+
</testsuites>
19+
20+
<filter>
21+
<whitelist>
22+
<directory>src/</directory>
23+
</whitelist>
24+
</filter>
25+
</phpunit>

0 commit comments

Comments
 (0)