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

[3.1.0] Add Postgres Support #91

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open

Conversation

lupinitylabs
Copy link
Member

@lupinitylabs lupinitylabs commented Sep 5, 2024

This PR adds support for PostgreSQL databases, and additionally replaces the manual MySQL dump import logic with the default SchemaState load() method.

Also, it now prints the full dump path on the console after protector:export, and colorizes the output for improved legibility.

Testing status:

  • Export works with MySQL
  • Import works with MySQL
  • Remote import works with MySQL
  • Export works with Postgres
  • Import works with Postgres
  • Remote import works with Postgres.

In replacement of the manual drop/re-create database logic, we are now wiping the database prior to importing the dump. This can be prevented by using the --no-wipe option in protector:import.

Note

It should be discussed whether we should just drop the tables, or really drop views and types, too.
Since they are potentially both part of the dump, it seems to make sense to wipe it all.

@lupinitylabs
Copy link
Member Author

lupinitylabs commented Sep 5, 2024

Please note that no cleanup has been done in detail.
I suppose a lot of the MySQL exec handling code can be removed after adopting this.

Also, I added a section on migrating from v2 to v3 - which is lacking any information, so maybe we can tackle #89 while we are at it?

@lupinitylabs
Copy link
Member Author

We might also want to test a Postgres setup in the workflow from here on, but I guess your new workflow setup doesn't allow for different databases at this point?

@lupinitylabs lupinitylabs linked an issue Sep 5, 2024 that may be closed by this pull request
@mszulik
Copy link
Contributor

mszulik commented Sep 8, 2024

We might also want to test a Postgres setup in the workflow from here on, but I guess your new workflow setup doesn't allow for different databases at this point?

You can add support for it if you want, the repository is public: https://github.com/cybex-gmbh/github-workflows
Otherwise I will try to add it as soon as I have time.

I also created an issue for this: cybex-gmbh/github-workflows#11

@lupinitylabs
Copy link
Member Author

This pull request includes several updates to the protector package, notably adding PostgreSQL support, updating documentation, and enhancing the codebase with new features and improvements. The most important changes include updates to the CHANGELOG.md, improvements to the README.md, additions to the composer.json file, new schema state proxy classes, and modifications to the Protector class to handle PostgreSQL.

Documentation Updates:

  • CHANGELOG.md: Updated to include PostgreSQL support and other version changes.
  • README.md: Updated supported databases section to include PostgreSQL and added a migration guide from v2.x to v3.x. [1] [2]

Dependency and Configuration Updates:

  • composer.json: Added laravel/pint as a development dependency and included a new developer in the authors section. [1] [2]
  • pint.json: Added configuration for laravel/pint code style fixer.

Schema State Proxy Classes:

Core Functionality Enhancements:

  • src/Protector.php: Updated to handle PostgreSQL schema state and added error handling for import and wipe operations. [1] [2]

@mszulik
Copy link
Contributor

mszulik commented Oct 8, 2024

We might also want to test a Postgres setup in the workflow from here on, but I guess your new workflow setup doesn't allow for different databases at this point?

You can add support for it if you want, the repository is public: https://github.com/cybex-gmbh/github-workflows Otherwise I will try to add it as soon as I have time.

I also created an issue for this: cybex-gmbh/github-workflows#11

Workflow update PR: cybex-gmbh/github-workflows#15
Protector PR: #93

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

Successfully merging this pull request may close these issues.

Add support for PostgreSQL
3 participants