morozov
Repos
53
Followers
58

Doctrine Database Abstraction Layer

0
0

Change data capture for a variety of databases. Please log issues at https://issues.redhat.com/browse/DBZ.

0
0

Events

issue comment
Typofixes

No, I missed that one.

Created at 17 hours ago
create branch
morozov create branch remove-table-diff-public-properties
Created at 18 hours ago
pull request closed
Merge 3.5.x into 4.0.x
Created at 18 hours ago

Do not list tables required by extensions

Merge pull request #5687 from morozov/issues/5668

Do not list tables required by extensions

Use RST syntax for links

This is markdown.

Remove trailing whitespace

Merge pull request #5688 from greg0ire/use-rst-syntax

Use rst syntax

Rework AbstractMySQLPlatformTestCas::testChangeIndexWithForeignKeys()

Rework MySQLSchemaTest::testSwitchPrimaryKeyOrder()

Rework AddColumnWithDefaultTest::testAddColumnWithDefault()

Update PHPStan to 1.8.6

Rework SQLServerSchemaManagerTest::testDropColumnConstraints()

Merge pull request #5713 from morozov/phpstan-1.8.6

Update PHPStan to 1.8.6

Merge pull request #5714 from morozov/rework-table-diff-tests

Rework some tests that instantiate TableDiff

Merge pull request #5715 from doctrine/3.4.x

Merge 3.4.x into 3.5.x

Count diff collections instead of using empty()

Do not count changes when comparing tables

Revert accidentally renamed variables

Fix invalid test

Mark TableDiff public properties internal

Merge pull request #5717 from morozov/table-diff-public-properties-internal

Mark TableDiff public properties internal

Merge branch '3.5.x' into 4.0.x

Created at 18 hours ago
pull request opened
Merge 3.5.x into 4.0.x
Created at 19 hours ago

Do not list tables required by extensions

Merge pull request #5687 from morozov/issues/5668

Do not list tables required by extensions

Use RST syntax for links

This is markdown.

Remove trailing whitespace

Merge pull request #5688 from greg0ire/use-rst-syntax

Use rst syntax

Remove fallback connection to determine platform

Remove SQLite property-based diff workaround

Merge pull request #5710 from morozov/remove-sqlite-property-based-diff-workaround

Remove property-based false-positive diff workaround from SQLite schema manager

Rework AbstractMySQLPlatformTestCas::testChangeIndexWithForeignKeys()

Rework MySQLSchemaTest::testSwitchPrimaryKeyOrder()

Rework AddColumnWithDefaultTest::testAddColumnWithDefault()

Merge pull request #5709 from morozov/remove-platform-detection-fallback

Remove platform detection fallback

Remove default PostgreSQL connection database

Remove default_dbname parameter of wrapper Connection

Remove exception handling in server version detection

Update PHPStan to 1.8.6

Rework SQLServerSchemaManagerTest::testDropColumnConstraints()

Merge pull request #5713 from morozov/phpstan-1.8.6

Update PHPStan to 1.8.6

Merge pull request #5714 from morozov/rework-table-diff-tests

Rework some tests that instantiate TableDiff

Merge pull request #5712 from morozov/remove-try-catch

Remove exception handling in server version detection

Created at 20 hours ago
delete branch
morozov delete branch table-diff-public-properties-internal
Created at 21 hours ago

Count diff collections instead of using empty()

Do not count changes when comparing tables

Revert accidentally renamed variables

Fix invalid test

Mark TableDiff public properties internal

Merge pull request #5717 from morozov/table-diff-public-properties-internal

Mark TableDiff public properties internal

Created at 21 hours ago
pull request closed
Mark TableDiff public properties internal

| Q | A |------------- | ----------- | Type | deprecation

The goals are:

  1. Improve encapsulation by forbidding uncontrolled access to the object state (properties) in favor of exchanging messages (calling methods).
  2. Simplify the underlying data structures by removing redundant information. Currently, the collections like $addedColumns contain column names twice: once as the array key and once as a property of the column under the key. The consistency between the keys and the values is not enforced: https://github.com/doctrine/dbal/blob/120be86ed14673dbe90c4ea0991b3007fa358670/tests/Platforms/SqlitePlatformTest.php#L423 Having the objects indexed by the lower-case name at the abstraction level is prone to errors where object names are case-sensitive (always true for Oracle and IBM DB2, depends on the configuration for SQL Server,).

Change summary:

  1. Aim at building the diff once and accessing its state via methods.
  2. Change the wording in the names of the methods: changed → modified, removed → dropped, which is closer to the SQL terminology.
  3. Where it's hard to get rid of the diff modification but is possible to create a new instance, do that. Note, we don't want to have any with*() methods within the diff itself since all these cases are invalid and exist only for historical reasons.
  4. The diff constructor accepts most of the collections as array<T> (as the keys don't matter) and assigns them to the corresponding properties as is. The corresponding methods return the collection as list<T> by converting them via array_values(). This way, by opting into using the methods, the API consumer has to stop using the keys. In 4.0, the constructor will accept most of the collections as list<T>, so the array_values() conversion will be no longer necessary.

Rough edges:

  1. The MySQL schema manager still needs some indexes and columns to be indexed by name to handle some edge cases related to the primary key.
  2. DB2 does something similar.
  3. MySQL "optimizes" handling of some changes in indexes and removes the ones that it has already handled from the diff.
  4. The comparator modifies table diffs right after creation.

In order to keep the support for the edge cases where a diff needs to be modified, we introduce internal methods which can be removed in the future. Right now, it looks like getting rid of each of them is a complex project that needs additional research.

Created at 21 hours ago

Mark TableDiff public properties internal

Created at 1 day ago
pull request opened
Mark TableDiff public properties internal

| Q | A |------------- | ----------- | Type | deprecation

The goals are:

  1. Improve encapsulation by forbidding uncontrolled access to the object state (properties) in favor of exchanging messages (methods).
  2. Simplify the underlying data structures by removing redundant information. Currently, the collections like $addedColumns contain column names twice: once as the array key and once as a property of the column under the key. The consistency between the keys and the values is not enforced (see the invalid test below), and it is not documented what the keys should be. Having the objects indexed by the lower-case name at the abstraction level is prone to errors where object names are or may be case-sensitive (e.g. SQL Server, Oracle, IBM DB2).

Rough edges:

  1. MySQL still needs some indexes and columns to be indexed by name to handle some edge cases.
  2. DB2 does something similar.
  3. MySQL "optimizes" handling of some changes in indexes and removes the ones that it has already handled from the diff.
  4. The comparator modifies table diffs right after creation.

In order to keep the support for these edge cases, we can introduce internal methods that can be removed in the future. Right now, it looks like getting rid of each of them is a complex project.

Created at 1 day ago
create branch
morozov create branch table-diff-public-properties-internal
Created at 1 day ago
delete branch
morozov delete branch deprecate-table-diff-public-properties
Created at 1 day ago

Do not list tables required by extensions

Merge pull request #5687 from morozov/issues/5668

Do not list tables required by extensions

Use RST syntax for links

This is markdown.

Remove trailing whitespace

Merge pull request #5688 from greg0ire/use-rst-syntax

Use rst syntax

Update PHPStan to 1.8.6

Merge pull request #5713 from morozov/phpstan-1.8.6

Update PHPStan to 1.8.6

Merge pull request #5715 from doctrine/3.4.x

Merge 3.4.x into 3.5.x

Count diff collections instead of using empty()

Do not count changes when comparing tables

Revert accidentally renamed variables

Fix invalid test

Mark TableDiff public properties internal

Created at 1 day ago

Rework AbstractMySQLPlatformTestCas::testChangeIndexWithForeignKeys()

Rework MySQLSchemaTest::testSwitchPrimaryKeyOrder()

Rework AddColumnWithDefaultTest::testAddColumnWithDefault()

Rework SQLServerSchemaManagerTest::testDropColumnConstraints()

Merge pull request #5714 from morozov/rework-table-diff-tests

Rework some tests that instantiate TableDiff

Count diff collections instead of using empty()

Do not count changes when comparing tables

Revert accidentally renamed variables

Fix invalid test

Mark TableDiff public properties internal

Created at 2 days ago

Do not list tables required by extensions

Merge pull request #5687 from morozov/issues/5668

Do not list tables required by extensions

Use RST syntax for links

This is markdown.

Remove trailing whitespace

Merge pull request #5688 from greg0ire/use-rst-syntax

Use rst syntax

Update PHPStan to 1.8.6

Merge pull request #5713 from morozov/phpstan-1.8.6

Update PHPStan to 1.8.6

Merge pull request #5715 from doctrine/3.4.x

Merge 3.4.x into 3.5.x

Created at 2 days ago
pull request closed
Merge 3.4.x into 3.5.x
Created at 2 days ago
delete branch
morozov delete branch remove-pdo-pgsql-default-dbname
Created at 2 days ago

Remove default PostgreSQL connection database

Remove default_dbname parameter of wrapper Connection

Merge pull request #5711 from morozov/remove-pdo-pgsql-default-dbname

Remove PostgreSQL-specific connection parameters and behavior

Created at 2 days ago
pull request closed
Remove PostgreSQL-specific connection parameters and behavior

The features being removed were deprecated in https://github.com/doctrine/dbal/pull/5705.

Created at 2 days ago