{"id":37144405,"url":"https://github.com/pdok/go-cloud-sqlite-vfs","last_synced_at":"2026-01-14T16:57:21.702Z","repository":{"id":193514320,"uuid":"688447140","full_name":"PDOK/go-cloud-sqlite-vfs","owner":"PDOK","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-04T08:26:21.000Z","size":3662,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-04T09:44:59.368Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PDOK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-07T11:19:28.000Z","updated_at":"2024-06-04T08:25:27.000Z","dependencies_parsed_at":"2024-06-04T09:44:12.310Z","dependency_job_id":"90eb500e-a921-4413-9dbb-60f22dea2898","html_url":"https://github.com/PDOK/go-cloud-sqlite-vfs","commit_stats":null,"previous_names":["pdok/go-cloud-sqlite-vfs"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/PDOK/go-cloud-sqlite-vfs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PDOK%2Fgo-cloud-sqlite-vfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PDOK%2Fgo-cloud-sqlite-vfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PDOK%2Fgo-cloud-sqlite-vfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PDOK%2Fgo-cloud-sqlite-vfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PDOK","download_url":"https://codeload.github.com/PDOK/go-cloud-sqlite-vfs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PDOK%2Fgo-cloud-sqlite-vfs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28427166,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-14T16:57:20.969Z","updated_at":"2026-01-14T16:57:21.698Z","avatar_url":"https://github.com/PDOK.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-cloud-sqlite-vfs\n\n## Description\n\nThis project wraps the [Cloud Backed SQLite](https://sqlite.org/cloudsqlite/doc/trunk/www/index.wiki) (CBS)\nsolution into a Go package. The project uses [The SQLite OS Interface or \"VFS\"](https://www.sqlite.org/vfs.html)\nconcept to create a VFS which is backed by either Azure Blob Storage or Google Cloud Storage. The VFS can be used \nwith every SQLite Go package as long as it supports setting a custom VFS name.\n\nBelow are some examples about how to use this package, for further information about the workings of this package\nplease read the [documentation](https://sqlite.org/cloudsqlite/doc/trunk/www/index.wiki) of the CBS project.\n\n## Installation\n\nThis package can be installed with the `go get` command:\n\n```bash\ngo get github.com/PDOK/go-cloud-sqlite-vfs \n```\n\n**go-cloud-sqlite-vfs is cgo package**. If you want to build your app using go-cloud-sqlite-vfs, you need a C-compiler like gcc.\n\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/PDOK/go-cloud-sqlite-vfs\"\n\t\"github.com/jmoiron/sqlx\"\n\t_ \"github.com/mattn/go-sqlite3\"\n)\n\nconst (\n\tSTORAGE         = \"azure?emulator=127.0.0.1:10000\"\n\tACCOUNT         = \"\u003cACCOUNT\u003e\"\n\tKEY             = \"\u003cKEY\u003e\"\n\tCONTAINER_NAME  = \"\u003cCONTAINER_NAME\u003e\"\n\tVFS_NAME        = \"myvfs\"\n\tCACHE_DIR       = \"./tmp\"\n\tSQLITE_FILENAME = \"\u003cSQLITE_FILENAME\u003e\"\n)\n\nfunc main() {\n\tvfs, err := cloud_sqlite_vfs.NewVFS(VFS_NAME, STORAGE, ACCOUNT, KEY, CONTAINER_NAME, CACHE_DIR)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\tdb, err := sqlx.Open(\"sqlite3\", \"/\"+CONTAINER_NAME+\"/\"+SQLITE_FILENAME+\"?vfs=\"+VFS_NAME)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\tfmt.Println(db)\n\n\terr = vfs.Close()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n}\n```\n\n## Example project\n\n1. Build `blockcachevfsd` cli. For instructions see the [CBS website](https://sqlite.org/cloudsqlite/doc/trunk/www/index.wiki)\n2. Start Azurite\n    ```bash\n    docker run -p 10000:10000 mcr.microsoft.com/azure-storage/azurite azurite-blob --blobHost 0.0.0.0\n    ```\n3. Create an `account.txt` file with the following content (don't forget the linebreak):\n    ```\n   -module azure?emulator=127.0.0.1:10000\u0026sas=0\n   \n   ```\n4. Create a container in Azurite\n    ```bash\n    ./blockcachevfsd create -f account.txt example\n    ```\n5. Upload the SQLite database to the newly created container on Azurite\n    ```bash\n   ./blockcachevfsd upload -f account.txt -container example ./chinook.db chinook.db\n   ```\n6. Run the example application\n   ```bash\n   go run ./\n   ```\n   \n## Dev\n\nBecause the C code of the [CBS project](https://sqlite.org/cloudsqlite/dir?ci=tip) needs to be included in \nthe package it can be updated with the `download-c-code.sh` script located in the root of this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdok%2Fgo-cloud-sqlite-vfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpdok%2Fgo-cloud-sqlite-vfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdok%2Fgo-cloud-sqlite-vfs/lists"}