Skip to content

Add abstrction to Rdbms Container #25

Description

@hantsy

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions