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 abstrction to Rdbms Container #25

Open
hantsy opened this issue Dec 29, 2024 · 0 comments
Open

Add abstrction to Rdbms Container #25

hantsy opened this issue Dec 29, 2024 · 0 comments

Comments

@hantsy
Copy link

hantsy commented Dec 29, 2024

In the Java implementation, there is a JdbcDatabaseContainer abstract class(it should be an interface from the design view) and an R2dbcDatabaseContainer interface to unite the common properties when connecting Rdbms with JDBC or R2dbc driver.

In this PHP implementation, common properties such as databaseName, username, password, etc., are varied in different database containers.

For example, MySQL:

$container->withMariaDBDatabase('foo');
$container->withMariaDBUser('bar', 'baz');

and Postgres:

->withPostgresUser('test')
->withPostgresDatabase('foo')

These properties' naming looks a little tedious, we know the database type when creating the container, so why add database type as the prefix of these properties?

It is better to use some interface to unite these properties for Rdbms.

  • DatabaseName
  • Username
  • Password
  • TestQueryString
interface RdbmsContainer{ 
}

Or PdoDatabaseContainer and DoctrineDatabaseContainer to add driver-specific properties, as described in #23.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant