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

Unable to deal with custom Doctrine types (Case 167398) #96

Closed
mpdude opened this issue Oct 25, 2022 · 0 comments · Fixed by #102
Closed

Unable to deal with custom Doctrine types (Case 167398) #96

mpdude opened this issue Oct 25, 2022 · 0 comments · Fixed by #102

Comments

@mpdude
Copy link
Member

mpdude commented Oct 25, 2022

Assume your database contains a table with a definition like so:

CREATE TABLE `test` (
  `some_col` int NOT NULL COMMENT '(DC2Type:some_type)'
)

In your application, you may have configured Doctrine with some special (custom) mapping type, thus the comment (DC2Type:some_type).

When trying to dump this database, slimdump fails with an exception when trying to load the schema information, since the some_type type is not known to DBAL.

It should not be necessary to configure this type either; in fact, we (probably) don't care about types that much, we just need to decide whether or not we're dealing with BLOB values.

Probably we need to come up with a clever way of how/when to register placeholder types dynamically?

@janopae janopae changed the title Unable to deal with custom Doctrine types Unable to deal with custom Doctrine types (Case 167398) Jan 16, 2024
mpdude added a commit that referenced this issue Jan 18, 2024
We're using the `SchemaManager` to simplify listing tables, views and so
on. But, the information provided by it also includes the DBAL types
used for columns, and that information may be parsed from column
comments in the database.

The problem is that a table definition like so:

```sql
CREATE TABLE `test` (
  `some_col` int NOT NULL COMMENT '(DC2Type:some_type)'
)
```

... `slimdump` fail fail with an exception because it does not know
about the `some_type`. This type may be available and defined in your
application, but we cannot put it into the `slimdump` command.

Now, in fact, we don't care about the type and its conversion
capabilities at all. So, this PR adds a runtime "just in type"
registration of a `DummyType` that serves as a placeholder to avoid
issues when loading the schema.

Fixes #96.
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 a pull request may close this issue.

1 participant