auraphp/Aura.SqlSchema

Missing table reflection

mindplay-dk opened this issue · 10 comments

Table reflection is missing - we need a table model to reflect things like comments on tables, storage types, and whatever other table metadata each storage engine might provide.

This will be a BC break, since tables are currently reflected as strings, so there is no existing table model we can flesh out with these properties.

Also missing is indices, constraints, foreign keys, relations...

Seeing as we have only a "Google beta" release thus far, a BC break is not as big as deal as it might be otherwise. If you have a PR you'd like to submit here, I'd be happy to review it.

I don't personally have any reason to implement schema reflection for anything other than MySQL - implementing support for all of the database backends would be a pretty substantial task.

Probably a lot of the implementation details could be referenced from Yii which has a fairly complete table schema reflection for most backends.

I agree that it's a substantial task, which is why I'm not eager to take it on myself at this time. If you're not willing to do it (yet) and I'm not (yet), can we close this issue for the time being?

A dedicated schema reflection library that doesn't fully reflect table schema seems pretty half-baked to me. May I ask what you're using it for? I don't imagine most common tasks like generating migrations or code/models would be possible without at least primary keys being reflected? These would be the things I would use schema reflection for myself.

It serves mostly place for functionality extracted from the v1 Aura.Sql. Like I said, if you're interested in doing the work to provide the reflection stuff you see as missing, even if it's only for the one backend, I'd be happy to review.

I have no pressing need for it at the moment, and too many other open source projects I'm working on...

I know that feeling all too well. :-/

Maybe the README should clarify the fact that the library provides only column (not table) schema reflection at the moment?

I have no problem with explicitly stating that, although in fairness no other functionality is described there.