{"id":20041240,"url":"https://github.com/gernest/qlstore","last_synced_at":"2025-07-23T11:40:11.526Z","repository":{"id":57488971,"uuid":"76774757","full_name":"gernest/qlstore","owner":"gernest","description":"gorilla/sessions storage with embedded sql database( (ql)","archived":false,"fork":false,"pushed_at":"2016-12-24T08:54:17.000Z","size":18,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-08T19:47:46.596Z","etag":null,"topics":["embedded-sql-database","gorilla","qlrace","session"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gernest.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-18T09:45:35.000Z","updated_at":"2025-01-02T06:17:24.000Z","dependencies_parsed_at":"2022-08-29T09:10:15.522Z","dependency_job_id":null,"html_url":"https://github.com/gernest/qlstore","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gernest%2Fqlstore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gernest%2Fqlstore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gernest%2Fqlstore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gernest%2Fqlstore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gernest","download_url":"https://codeload.github.com/gernest/qlstore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252466781,"owners_count":21752430,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded-sql-database","gorilla","qlrace","session"],"created_at":"2024-11-13T10:45:56.716Z","updated_at":"2025-05-05T08:32:14.109Z","avatar_url":"https://github.com/gernest.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# qlstore\n\n[![GoDoc](https://godoc.org/github.com/gernest/qlstore?status.svg)](https://godoc.org/github.com/gernest/qlstore) [![Build Status](https://travis-ci.org/gernest/qlstore.svg?branch=master)](https://travis-ci.org/gernest/qlstore) [![Coverage Status](https://coveralls.io/repos/github/gernest/qlstore/badge.svg?branch=master)](https://coveralls.io/github/gernest/qlstore?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/gernest/qlstore)](https://goreportcard.com/report/github.com/gernest/qlstore)\n\nImplements [gorilla/sessions](https://github.com/gorilla/sessions) store using embedded sql database ( [ql](https://github.com/cznic/ql))\n\n# installation\n\n\tgo get github.com/gernest/qlstore\n\n# Usage\n```go\n\npackage main\n\nimport (\n\t\"database/sql\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/gernest/qlstore\"\n\t// load ql drier\n\t_ \"github.com/cznic/ql/driver\"\n)\n\nvar keyPair = [][]byte{\n\t[]byte(\"ePAPW9vJv7gHoftvQTyNj5VkWB52mlza\"),\n\t[]byte(\"N8SmpJ00aSpepNrKoyYxmAJhwVuKEWZD\"),\n}\n\nfunc main() {\n\n\tdb, err := sql.Open(\"ql-mem\", \"testing.db\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// This is a convenient helper. It creates the session table if the table\n\t// doesnt exist yet.\n\terr = qlstore.Migrate(db)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tstore := qlstore.NewQLStore(db, \"/\", 2592000, keyPair...)\n\thttp.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\t// Get a session. We're ignoring the error resulted from decoding an\n\t\t// existing session: Get() always returns a session, even if empty.\n\t\tsession, _ := store.Get(r, \"session-name\")\n\t\t// Set some session values.\n\t\tsession.Values[\"foo\"] = \"bar\"\n\t\tsession.Values[42] = 43\n\t\t// Save it before we write to the response/return from the handler.\n\t\tsession.Save(r, w)\n\t})\n\tlog.Fatal(http.ListenAndServe(\":8090\", nil))\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgernest%2Fqlstore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgernest%2Fqlstore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgernest%2Fqlstore/lists"}