FUNCTION-DELETE(3valkey)

πŸ“¦
version 9.0.6 Β· 2 versions
, in fedora 44

πŸ’… FUNCTION-DELETE(3valkey) πŸ’…

okay bestie, welcome to the Valkey Command Manual β€” this one's a little brutal but honestly iconic for it. it's function-delete, and yes it does exactly what it says on the tin 🫢


✨ NAME ✨

function-delete β€” Deletes a library and its functions.


🌸 SYNOPSIS 🌸

FUNCTION DELETE library-name

πŸ¦‹ DESCRIPTION πŸ¦‹

So. You know how a library is like, a whole squad of functions living together? Yeah. This command deletes the library called library-name and every single function inside it. no survivors. no takebacks. it's giving spring cleaning but with zero mercy πŸ’€

If the library doesn't exist, the server hits you with an error. so like, don't try to delete a ghost library, it will simply not work.

For more information please refer to valkey-functions-intro(7) β€” Introduction to Valkey Functions. go read it, it's lowkey required reading for the function girlies.


πŸ’Œ REPLY πŸ’Œ

valkey-protocol(7) Simple string reply: OK.


⚑ COMPLEXITY ⚑

O(1)

constant time, babes. it's fast, it's efficient, it's the main character of complexity classes ✨


πŸ‘‘ ACL CATEGORIES πŸ‘‘

  • @scripting
  • @slow
  • @write

πŸŽ€ HISTORY πŸŽ€

  • Available since: 7.0.0

πŸ“ EXAMPLES πŸ“

watch and learn, bestie:

127.0.0.1:6379> FUNCTION LOAD "#!lua name=mylib \n server.register_function('myfunc', function(keys, args) return 'hello' end)"
"mylib"
127.0.0.1:6379> FCALL myfunc 0
"hello"
127.0.0.1:6379> FUNCTION DELETE mylib
OK
127.0.0.1:6379> FCALL myfunc 0
(error) ERR Function not found

see that last bit? 😭 you deleted mylib, so myfunc is gone gone. the FCALL comes back with (error) ERR Function not found and honestly? that's just consequences. periodt.


🌈 SEE ALSO 🌈


and that's the whole page, bestie πŸ§šπŸ’– this cutie is from Valkey 9.0.0, dated 2025-10-21. go forth, delete responsibly, and don't come crying to me when your functions are gone πŸ’…βœ¨

πŸ“¦ where this page comes from