Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PostgreSQL DB driver #52

Merged
merged 17 commits into from Jul 12, 2019
Merged

Add PostgreSQL DB driver #52

merged 17 commits into from Jul 12, 2019

Conversation

stancl
Copy link
Member

@stancl stancl commented Jun 29, 2019

Fixes #51

src/TenantDatabaseManagers/PostgreSQLDatabaseManager.php Outdated Show resolved Hide resolved

$db_name = 'testdatabase' . $this->randomString(10);
app(DatabaseManager::class)->create($db_name, 'pgsql');
$this->assertNotEmpty(DB::select("SELECT datname FROM pg_database WHERE datname = '$db_name'"));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a correct way of checking that a database exists?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is, but Postgres converts all DB names to lowercase while the WHERE clause does not.

@stancl stancl added the help wanted Extra attention is needed label Jun 30, 2019
@stancl stancl added this to the 1.5.0 milestone Jul 12, 2019
@codecov
Copy link

codecov bot commented Jul 12, 2019

Codecov Report

Merging #52 into 1.x will increase coverage by 0.13%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##                1.x     #52      +/-   ##
===========================================
+ Coverage     88.26%   88.4%   +0.13%     
- Complexity      128     130       +2     
===========================================
  Files            22      23       +1     
  Lines           341     345       +4     
===========================================
+ Hits            301     305       +4     
  Misses           40      40
Impacted Files Coverage Δ Complexity Δ
src/config/tenancy.php 100% <ø> (ø) 0 <0> (ø) ⬇️
src/DatabaseManager.php 95% <100%> (ø) 17 <0> (ø) ⬇️
...nantDatabaseManagers/PostgreSQLDatabaseManager.php 100% <100%> (ø) 2 <2> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5b7755...11b4591. Read the comment docs.

@stancl stancl merged commit b2e2460 into 1.x Jul 12, 2019
@stancl stancl deleted the postgres branch July 24, 2019 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Write a Postgres DB manager
1 participant