HUGO

Is there any way to add an SQL database to a Hugo site? (Newb question)

SQL Functionality

I understand Hugo is a static site generator, but I’m trying to figure out a way to make it work with an SQL backend to track membership in a club. Is this at all possible?

Thanks in advance for any tips!

If you want to go the “database” way with a statically generated site, you have to go the “lambda functions” way, I guess.

See Netlify Functions to get the whole idea.

Does it need to display the club members on the site or is it just to add new people who sign up to an existing tracking system?

For the latter: personally what I would do is deploy with Netlify and use Netlify forms. Create an automation in Zapier to send the data to a Google spreadsheet or something like Airtable. Or any other form/automation solution.

Database is overkill if it’s just for tracking members imo.

Wouldn’t it be easier to just use Google Forms directly then?

Edit: Here’s a demo of Google Forms on my Hugo powered website.

Personally I prefer to style my own forms and add to an email list but for a club it might be enough.

Hugo is incapable of providing any sort of back-end or access to the database to store user data and roles. You would have to employ another solution.

You’d have to write a back-end service and a front-end part to communicate with it.

I have something I proposed here which works for me. Perhaps you can generate pages like this. But that’s about all. There is no way to have a user roles system in a static site.