{"id":17694983,"url":"https://github.com/asg017/sqlite-package-manager","last_synced_at":"2025-05-13T03:42:09.035Z","repository":{"id":177874763,"uuid":"624983655","full_name":"asg017/sqlite-package-manager","owner":"asg017","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-01T14:37:53.000Z","size":38,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-01T06:15:53.617Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/asg017.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-04-07T18:55:21.000Z","updated_at":"2024-05-03T09:33:42.000Z","dependencies_parsed_at":"2023-07-10T19:01:44.402Z","dependency_job_id":null,"html_url":"https://github.com/asg017/sqlite-package-manager","commit_stats":null,"previous_names":["asg017/sqlite-package-manager"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asg017%2Fsqlite-package-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asg017%2Fsqlite-package-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asg017%2Fsqlite-package-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asg017%2Fsqlite-package-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asg017","download_url":"https://codeload.github.com/asg017/sqlite-package-manager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253870814,"owners_count":21976610,"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":[],"created_at":"2024-10-24T13:50:42.835Z","updated_at":"2025-05-13T03:42:09.011Z","avatar_url":"https://github.com/asg017.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sqlite-package-manager\n\n**Warning**\n\n\u003e `spm` is in active development! Also consider Anton Zhiyanov's [sqlpkg](https://github.com/nalgeon/sqlpkg).\n\n`sqlite-package-manager`, or spm for short, will be an npm-like tool for downloading and manage SQLite extensions. Unlike the pip/npm/gem bindings I described above, spm will be a language-agnostic tool, distributed as a single-binary CLI.\n\nIt's similar to npm, pip, gem, and cargo, but with a few key differences. You'll start a spm project like so:\n\n```bash\nspm init\n```\n\nWhich creates an `spm.toml` file in your current directory, similar to a `requirements.txt`, `package.json`, `Gemfile`, or `Cargo.toml` file. It contains a list of \"dependencies\" (SQLite extensions) that you can edit by hand or with the spm CLI, like with the \"spm add\" command:\n\n```bash\nspm add github.com/asg017/sqlite-http\nspm add github.com/asg017/sqlite-html\nspm add github.com/asg017/sqlite-vss\n```\n\nWhich would generate the following config in your `spm.toml`:\n\n```toml\n[extensions]\n\"https://github.com/asg017/sqlite-http\" = \"v0.1.0-alpha.7\"\n\"https://github.com/asg017/sqlite-html\" = \"v0.1.2-alpha.7\"\n\"https://github.com/asg017/sqlite-vss\" = \"v0.1.1-alpha.19\"\n```\n\nAdditionally, an `spm.lock` file will be generated alongside your `spm.toml` file, which contains detailed checksums and URLs of the downloaded SQLite extensions (similar to `package-lock.json`, `yarn.lock`, `Pipfile.lock`, `Gemfile.lock`, `Cargo.lock`).\n\nYou'll find these downloaded pre-compiled extensions in the new `sqlite_extensions/` directory alongside your project! Think of this like a `node_modules/`, `site-packages`, or `target/` directory, which contains the downloaded code of your dependencies. The extensions that are downloaded are for your current operating system and CPU architecture - in this case, the MacOS x86_64 `.dylib` files for my computer.\n\n```\n$ tree .\n.\n├── spm.lock\n├── spm.toml\n└── sqlite_extensions\n    ├── html0.dylib\n    ├── http0.dylib\n    ├── vector0.dylib\n    └── vss0.dylib\n\n1 directory, 6 files\n```\n\nTo use these extensions, you could load them manually from the `sqlite_extensions/` directory, like `.load ./sqlite_extensions/html0`.\n\nAlternatively, use the `spm run` command and reference the extensions you want by name, without the `sqlite_extensions/` prefix. for example, for the following `build.sql` file:\n\n```sql\n.load html0\n.load http0\n\ncreate table foo(bar text);\n\ninsert into foo\nvalues(html_extract(http_get('https://...')));\n```\n\nYou can run the above with the `sqilte3` CLI like so:\n\n```bash\nspm run -- sqlite3 data.db '.read build.sql'\n```\n\nThe `.load html0` statement will automatically load in from your `spm` environment.\n\nYou can additionally use spm activate/deactivate to create a light \"spm environment\" in your current shell.\n\n```bash\n$(spm activate)\nsqlite3 data.db '.read build.sql'\n$(spm deactivate)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasg017%2Fsqlite-package-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasg017%2Fsqlite-package-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasg017%2Fsqlite-package-manager/lists"}