spacecodeur
spacecodeur

Reputation: 2406

MariaDB, is there a way for alter a query before his execution?

I have some web applications connected to MariaDB. I can't modify the code of these applications but I want run some scripts when theses applications query the database.

Example : if the application A add certain values in his database, I want add certain values in an another database used by the application B

There are two approach (maybe more ?) :

I think the fist way is the best approach..but I don't now if its possible to do that. What's the best solution and how can I do that ?

Thank you !

Upvotes: 0

Views: 250

Answers (1)

Rick James
Rick James

Reputation: 142278

A TRIGGER (MariaDB or MySQL) can be invoked to perform operations when a write operation occurs. You specify whether it is INSERT or UPDATE, etc, and what table is involved.

cron or MariaDB/MySQL EVENT can periodically do something.

The "query rewrite" feature "catches the query and allows for changing it before being submitted. It is available in MySQL 5.7, but not MariaDB.

Would you care to explain what you are trying to do.

Upvotes: 1

Related Questions