Closed Jleagle closed 1 year ago
If database support query in json a workaround would be store the metadata as JSON format. Then you could query like:
-- Postgres
SELECT *
FROM json_array_elements('[
{ "name": "Toby", "occupation": "Software Engineer" },
{ "name": "Zaphod", "occupation": "Galactic President" }
]') AS elem
WHERE elem->>'name' = 'Toby';
@Jleagle I just got published my example about sessions: https://github.com/gofiber/recipes/tree/master/sessions-sqlite3 take a look!
@Jleagle Can this be closed now that an example was posted?
Hi, is it possible to store meta data such as the user id into a new column. I am looking to list all a users sessions when you are logged in to view and delete them. Other info might be useful for me such as ip or user agent but i can probably get that from the value column. However i try this, it requires changing the interface signature which is obviously a problem. Can it be done?
Thanks.