dsg-innosource / ads-tools

ADS Tools
0 stars 0 forks source link

Add ads:inspect Command or test #2

Open joefusco opened 6 years ago

joefusco commented 6 years ago

It would be really nice to have a console command or a test that can tell us if there are any common issues in the ADS, for example:

I'm sure there are other things we'd want to check, but this would be a good start.

sbeal333 commented 6 years ago

Would these be best as console commands, or do you think they might be better as some sort of default suite of tests that get created via a console command?

joefusco commented 6 years ago

I'm thinking it might be best as a console command. Something similar to this:

https://github.com/beyondcode/laravel-self-diagnosis

joefusco commented 6 years ago

to capture table names and aliases: (from|join)\s[a-zA-Z0-9_-]*\s[a-zA-Z0-9_-]*(?=\s)

to capture join criteria: (on)\s[a-zA-Z0-9._-\s!=<>]*(?=inner|where|left|right|cross|full|join|union|;)

to capture where clause criteria: (where|and|or)\s[a-zA-Z0-9][.][a-zA-Z0-9]*\s