{"id":29111903,"url":"https://github.com/orbitinghail/libgraft.swift","last_synced_at":"2026-01-20T16:33:52.949Z","repository":{"id":300262390,"uuid":"1005263134","full_name":"orbitinghail/libgraft.swift","owner":"orbitinghail","description":"The Graft SQLite extension packaged for Swift","archived":false,"fork":false,"pushed_at":"2025-06-20T18:17:10.000Z","size":17,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-19T07:26:06.041Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/orbitinghail.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,"zenodo":null}},"created_at":"2025-06-20T00:29:35.000Z","updated_at":"2025-06-20T18:17:12.000Z","dependencies_parsed_at":"2025-06-20T18:49:51.658Z","dependency_job_id":null,"html_url":"https://github.com/orbitinghail/libgraft.swift","commit_stats":null,"previous_names":["orbitinghail/libgraft.swift"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/orbitinghail/libgraft.swift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitinghail%2Flibgraft.swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitinghail%2Flibgraft.swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitinghail%2Flibgraft.swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitinghail%2Flibgraft.swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orbitinghail","download_url":"https://codeload.github.com/orbitinghail/libgraft.swift/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitinghail%2Flibgraft.swift/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266850966,"owners_count":23995185,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2025-06-29T10:02:18.502Z","updated_at":"2026-01-20T16:33:52.942Z","avatar_url":"https://github.com/orbitinghail.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Graft.swift\n\nThis repo is a Swift Package Manager (SPM) package to make it easier to use Graft within Swift projects.\n\n## Adding Graft.swift to Your Xcode Project\n\nFollow these steps to add `Graft.swift` to your Xcode project using Swift Package Manager:\n\n1. **Open your Xcode project**.\n\n2. **Go to** `File` \u003e `Add Package Dependencies...`\n\n3. **Enter the repository URL** for `Graft.swift` in the search bar (top right):\n\n   ```\n   https://github.com/orbitinghail/Graft.swift.git\n   ```\n\n4. **Select the version** you want to use (usually the latest).\n\n5. **Click \"Add Package\"**.\n\n6. **Add the Graft \"Package Product\" to your application target** on the next screen.\n\n7. **Import and initialize the library** during application startup:\n\n   ```swift\n   import Foundation\n   import Graft\n\n   // Configure Graft using graft.toml and environment variables\n   let fm = FileManager.default\n   let supportDir = try fm.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true)\n   let configPath = supportDir.appendingPathComponent(\"graft.toml\")\n   let dataPath = supportDir.appendingPathComponent(\"graft-data\")\n\n   // Create a graft.toml configuration file\n   // See https://graft.rs/docs/sqlite/config/ for all configuration options\n   let config = \"\"\"\n   data_dir = \"\\(dataPath.path)\"\n   make_default = true\n\n   [remote]\n   type = \"memory\"  // Use \"fs\" or \"s3_compatible\" for production\n   \"\"\"\n   try config.write(to: configPath, atomically: true, encoding: .utf8)\n\n   // Set the GRAFT_CONFIG environment variable\n   setenv(\"GRAFT_CONFIG\", configPath.path, 1)\n\n   // Initialize Graft - registers graft with SQLite\n   try Graft.static_init()\n\n   // Now you can use SQLite with Graft pragmas\n   // See https://graft.rs/docs/sqlite/pragmas/ for available pragmas\n   ```\n\n## Configuration\n\nGraft is configured via a `graft.toml` file. Key configuration options:\n\n- **data_dir**: Where Graft stores local LSM storage data\n- **remote**: Configuration for remote object storage (memory, filesystem, or S3-compatible)\n- **autosync**: Background synchronization interval in seconds\n- **make_default**: Makes Graft VFS the default for new connections\n- **log_file**: Path to write verbose operation logs\n\nSee the [Graft configuration documentation](https://graft.rs/docs/sqlite/config/) for complete details.\n\n## Using Graft\n\nOnce initialized, you can use Graft's custom SQLite pragmas to manage distributed databases:\n\n```sql\nPRAGMA graft_new;  -- Create a new volume\nPRAGMA graft_info;  -- Get volume information\nPRAGMA graft_push;  -- Push local changes to remote\nPRAGMA graft_pull;  -- Pull and merge remote changes\n```\n\nSee the [Graft pragmas documentation](https://graft.rs/docs/sqlite/pragmas/) for all available commands.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbitinghail%2Flibgraft.swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forbitinghail%2Flibgraft.swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbitinghail%2Flibgraft.swift/lists"}