{"id":46928263,"url":"https://github.com/firetiger-oss/go-duckfs","last_synced_at":"2026-04-24T12:34:26.340Z","repository":{"id":343154567,"uuid":"959894814","full_name":"firetiger-oss/go-duckfs","owner":"firetiger-oss","description":"DuckDB virtual file system based on io/fs","archived":false,"fork":false,"pushed_at":"2026-03-24T22:06:47.000Z","size":3822,"stargazers_count":16,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-04-08T10:20:09.059Z","etag":null,"topics":["duckdb","duckdb-extension","filesystem","go","golang","sandbox"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/firetiger-oss/go-duckfs","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/firetiger-oss.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-03T14:21:10.000Z","updated_at":"2026-03-24T22:06:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/firetiger-oss/go-duckfs","commit_stats":null,"previous_names":["firetiger-oss/go-duckfs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/firetiger-oss/go-duckfs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firetiger-oss%2Fgo-duckfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firetiger-oss%2Fgo-duckfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firetiger-oss%2Fgo-duckfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firetiger-oss%2Fgo-duckfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firetiger-oss","download_url":"https://codeload.github.com/firetiger-oss/go-duckfs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firetiger-oss%2Fgo-duckfs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32224269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T10:26:35.452Z","status":"ssl_error","status_checked_at":"2026-04-24T10:25:27.643Z","response_time":64,"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":["duckdb","duckdb-extension","filesystem","go","golang","sandbox"],"created_at":"2026-03-11T04:00:14.470Z","updated_at":"2026-04-24T12:34:26.325Z","avatar_url":"https://github.com/firetiger-oss.png","language":"Go","funding_links":[],"categories":["Extensions"],"sub_categories":["Other Extensions"],"readme":"# go-duckfs [![Go Reference](https://pkg.go.dev/badge/github.com/firetiger-oss/go-duckfs.svg)](https://pkg.go.dev/github.com/firetiger-oss/go-duckfs)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/logo.png\" alt=\"go-duckfs logo\" width=\"400\"\u003e\n\u003c/p\u003e\n\nDuckDB virtual file system based on io/fs\n\n## Motivation\n\nThe purpose of this package is to allow Go programs to mount `io/fs` read-only\nfile systems as backend for DuckDB databases. It guarantees that all I/O will be\nexecuted by the Go runtime instead of being performed directly by DuckDB.\n\nDuckDB has extensions such as `httpfs` or `aws` to integrate the query engine\nwith data sets available over the network, but those are implemented in C++,\nthey don't share the same I/O stack as the rest of a Go application, and this\nduality introduces challenges when it comes to instrumentation, access control,\nor performance.\n\nBy sandboxing DuckDB via a _Virtual File System_, the `go-duckfs` package\nbridges all I/O operations back into the Go application to leverage pure Go\npackages like `net/http`, cloud vendor native SDKs, telemetry wrappers, etc...\n\n## Building\n\nThe package requires C++ symbols that are not present in the go-duckdb static\nbuild. The recommended way to install DuckDB is via [pixi](https://pixi.sh):\n\n```bash\n# Install DuckDB library\npixi install --locked\n\n# Build with dynamic linking\nCGO_ENABLED=1 \\\nCGO_LDFLAGS=\"-L.pixi/envs/default/lib\" \\\ngo build -tags=duckdb_use_lib\n```\n\nThe Go program must be compiled using the `duckdb_use_lib` tag to select the\nversion of the DuckDB Go bindings suited for dynamic linking.\n\nSee also: https://github.com/duckdb/duckdb-go?tab=readme-ov-file#linking-a-dynamic-library\n\n## Testing\n\nSince `go test` builds the program from sources, it is necessary to set the\nCGO environment variables and build tags:\n\n```bash\nCGO_ENABLED=1 \\\nCGO_LDFLAGS=\"-L.pixi/envs/default/lib\" \\\nLD_LIBRARY_PATH=\".pixi/envs/default/lib\" \\\ngo test -v ./... -tags=duckdb_use_lib\n```\n\n## Usage\n\nThe package exposes functions to create connectors for DuckDB instances with\na `fs.FS` as virtual file system, which can then be used to create a `sql.DB`.\n\n### Basic Example\n\n```go\nc, err := duckfs.Open(\"\", nil, os.DirFS(\"testdata\"))\nif err != nil {\n\tlog.Fatal(err)\n}\n\ndb := sql.OpenDB(c)\ndefer db.Close()\n\n// Query files using DuckDB's read functions\nrows, err := db.Query(`SELECT * FROM read_parquet('data.parquet')`)\n```\n\n### Protocol-Aware Filesystem\n\nVirtual paths use a protocol prefix (e.g., `test://file.parquet`). To handle\nthese paths, wrap your `fs.FS` to strip the protocol prefix:\n\n```go\ntype myFS struct {\n\tfsys fs.FS\n}\n\nfunc (f *myFS) Open(name string) (fs.File, error) {\n\t// Strip protocol prefix if present\n\tname = strings.TrimPrefix(name, \"myproto://\")\n\treturn f.fsys.Open(name)\n}\n```\n\nThen use it with DuckDB queries:\n\n```go\nc, err := duckfs.Open(\"\", nil, \u0026myFS{fsys: os.DirFS(\"data\")})\nif err != nil {\n\tlog.Fatal(err)\n}\n\ndb := sql.OpenDB(c)\ndefer db.Close()\n\n// Query using protocol prefix\nrow := db.QueryRow(`SELECT * FROM read_csv('myproto://records.csv')`)\n```\n\n## Contributing\n\nContributions are welcome! To get started:\n\n1. Ensure you have Go 1.24.0+ and [pixi](https://pixi.sh) installed\n2. Run `pixi install --locked` to install the DuckDB library\n3. Run tests using the commands in the [Testing](#testing) section\n\nPlease report bugs and feature requests via [GitHub Issues](https://github.com/firetiger-oss/go-duckfs/issues).\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiretiger-oss%2Fgo-duckfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffiretiger-oss%2Fgo-duckfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiretiger-oss%2Fgo-duckfs/lists"}