nevill / zongji

A mysql binlog listener running on Node.js.
Other
375 stars 118 forks source link

Exclude table prefix #131

Open brainsiq opened 3 years ago

brainsiq commented 3 years ago

Thanks for the useful module.

I have a database containing prefixed tables that I never want to consume through zongji but I don't really want to maintain that list of tables in the excludeSchema field as it changes reguarly.

It'd be nice to be able to pass prefixes to excudeSchema. Would you consider this a PR containing feature? Maybe excludeSchema and includeSchema could also accept an object like:

excludeSchema: { 'my_database': ['allow_table', 'another_table', { prefix: 'my_prefix' }], 'another_db': true }
brainsiq commented 3 years ago

The change to implement the above idea is pretty simple:

image