achiku / planter

Generate PlantUML ER diagram textual description from PostgreSQL tables
MIT License
546 stars 53 forks source link

Add support for Oracle DB #3

Closed tgulacsi closed 6 years ago

tgulacsi commented 7 years ago

I'm not sure about the changes in PostgreSQL queries (change of bool to int), but don't have pg at hand...

achiku commented 7 years ago

Thanks! I have to clean up code, and write tests before adding other database support since it is really messy right now (and yeah, tests are not really testing anything...). I'll let you know when it's done, and if you are still willing to send pr at that moment, I'll be more than welcome to merge it.

Plus, it'll be nice if we can discuss how to integrate multiple database support on issue comment or somewhere, before actually coding the feature :)

tgulacsi commented 7 years ago

I've written this first 'cause I need Oracle support, second to see where it needs some tweaking to support other databases. For general, this is some kind of query registry as different databases stores metadata differently, and to let the user declare the target db type in the connection string; for oracle specifically, I needed to downgrade the booleans to plain ints.

Tests can be done multiple ways:

  1. have tests for each db type, use specific env vars for each type, skipping the db test when the env var is empty,
  2. include some metadata in json format under testdata/ for each db type, and use that.

As Oracle is quite a heavy and niche DB, I've hidden it under "oracle" tag, so it's not included by default. Maybe the other not-so-common or needs-heavy-deps databases should be hidden behind such tags, too.