Goal: Want to create a so called "SQL Statement Layer" which checks/filters all incoming queries. If incoming query is invalid, should be denied.
Use-case: Limit database access and avoid unrevertable queries. No duplicate code in multiple applications about the same "triggers or procedures" (centralized).
Research so far:
- GRANTS/Privileges
- limit to Stored Procedures
Description: I am standing before a new project and we want to limit and minimize the access to the database. For example: The developer can create a DROP
query inside the Application layer but the database will deny this query because DROP
queries aren't allowed.
I worked some years ago with Laravel and did most of the "procedure and trigger" work inside the Application Layer like the Controllers instead of using a Mutator or Accessor. Now we want to cut it down to the lowest possible level to avoid duplicate code like Mutators and Accessors in different Applications.
Question: Are Grants and stored procedure the only way? If not, which ones?