About parameters.next method

Question in the book:

// 1
router.get(“api”, “acronyms”, Acronym.parameter) {
req → Future in
// 2
return try req.parameters.next(Acronym.self)
}

“Extract the acronym from the request using parameters. This computed property performs all the work necessary to get the acronym from the database.”

req.parameters.next(Acronym.self)

Why it can performs any process to grab data from database? How is the source code work on it?

@0xtim Can you please help with this when you get a chance? Thank you - much appreciated! :]

As well as the (very good) answer on StackOverflow - the part of the code you’re wanting to see is fluent/Model.swift at 3 · vapor/fluent · GitHub

This is the magic that Vapor and Fluent use to convert the parameter to the ID and perform the DB lookup. Hope that helps!

Thanks, I got the answer from SO.
Thanks to the help of @imike