#✅ Executing a SQL stored procedure in Directus?
8 messages · Page 1 of 1 (latest)
Thanks for posting! This is a community powered server, so you may or may not get an answer based on available help and expertise. To increase your chances of somebody being able to help you, please help us help you making sure you:
- Adding an explanation of exactly what you're trying to achieve.
- Adding any and all related code or previous attempts.
- Describing the exact issue or error you are facing.
- Posting any screenshots if applicable.
- Reading through https://stackoverflow.com/help/how-to-ask.
When you're done with this thread, please close it. Thanks! ✨
(If you have a support agreement and need help, please contact the core team via email.)
✅ Executing a SQL stored procedure in Directus?
You cannot call this directly from a flow. To calll a stored procedure you'd have to run a direct SQL query which is only possible from Custom API extensions.
HI @exotic dock , thanks for the reply! Really appreciate it.
Yeah, I'd imagine having an Operation in Directus Flow to execute SQL stored procedure would be cool.
I have been looking at this docs on creating custom Operation: https://docs.directus.io/extensions/operations.html
We can run plain queries with the [database — Knex instance that is connected to the current database.] in the Handler Function
I think this would be a cool project, but before I start to get deep in the "rabbit hole". Do you have a general idea of whether creating a custom operation for this would work?
Directus. An Instant App & API for your SQL Database.
Indeed a custom operation has access to the needed knex object and should work just fine 🙂
