{"id":24164479,"url":"https://github.com/opensvm/supabase-zig","last_synced_at":"2025-10-07T05:03:52.725Z","repository":{"id":271976315,"uuid":"914810029","full_name":"openSVM/supabase-zig","owner":"openSVM","description":"supabase zig client","archived":false,"fork":false,"pushed_at":"2025-01-11T05:53:21.000Z","size":12,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-02T11:49:35.748Z","etag":null,"topics":["supabase-client","supabase-db","supabse","zig","zig-package","zig-supabase"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openSVM.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}},"created_at":"2025-01-10T10:56:53.000Z","updated_at":"2025-05-28T15:54:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"8cbe82b0-37c3-4235-855d-6a6ed5d349ce","html_url":"https://github.com/openSVM/supabase-zig","commit_stats":null,"previous_names":["opensvm/supabase-zig"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/openSVM/supabase-zig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openSVM%2Fsupabase-zig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openSVM%2Fsupabase-zig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openSVM%2Fsupabase-zig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openSVM%2Fsupabase-zig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openSVM","download_url":"https://codeload.github.com/openSVM/supabase-zig/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openSVM%2Fsupabase-zig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278722754,"owners_count":26034462,"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-10-07T02:00:06.786Z","response_time":59,"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":["supabase-client","supabase-db","supabse","zig","zig-package","zig-supabase"],"created_at":"2025-01-12T19:17:25.697Z","updated_at":"2025-10-07T05:03:52.702Z","avatar_url":"https://github.com/openSVM.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# supabase-zig\n\nA Zig client library for [Supabase](https://supabase.com), providing a type-safe and memory-efficient way to interact with your Supabase backend.\n\n## Features\n\n- 🔐 **Authentication**: Full support for email/password authentication\n- 📊 **Database Operations**: Powerful query builder for database interactions\n- 🗄️ **Storage**: File upload, download, and management capabilities\n- 🔄 **Realtime**: Subscribe to database changes in real-time\n- 🛠️ **RPC**: Call Postgres functions directly\n- ⚡ **Performance**: Zero-allocation where possible, with careful memory management\n- 🔒 **Type Safety**: Leverage Zig's compile-time features for type-safe operations\n\n## Installation\n\nAdd this library to your `build.zig.zon`:\n\n```zig\n.{\n    .name = \"your-project\",\n    .version = \"0.1.0\",\n    .dependencies = .{\n        .supabase = .{\n            .url = \"https://github.com/your-username/supabase-zig/archive/refs/tags/v0.1.0.tar.gz\",\n            // Add the appropriate hash here\n        },\n    },\n}\n```\n\n## Quick Start\n\n```zig\nconst std = @import(\"std\");\nconst supabase = @import(\"supabase\");\n\npub fn main() !void {\n    // Initialize allocator\n    var gpa = std.heap.GeneralPurposeAllocator(.{}){};\n    defer _ = gpa.deinit();\n    const allocator = gpa.allocator();\n\n    // Create Supabase client\n    const config = supabase.SupabaseConfig.init(\n        \"YOUR_SUPABASE_URL\",\n        \"YOUR_SUPABASE_ANON_KEY\",\n    );\n    var client = try supabase.SupabaseClient.init(allocator, config);\n    defer client.deinit();\n\n    // Example: Query data\n    var query = try client.from(\"todos\")\n        .select(\"*\")\n        .limit(10);\n    defer query.deinit();\n\n    const result = try client.executeQuery(query);\n    defer result.deinit();\n}\n```\n\n## Authentication\n\n```zig\n// Sign up\nconst session = try client.signUp(\"user@example.com\", \"password123\");\ndefer session.deinit(allocator);\n\n// Sign in\nconst session = try client.signIn(\"user@example.com\", \"password123\");\ndefer session.deinit(allocator);\n\n// Sign out\ntry client.signOut(session.access_token);\n```\n\n## Database Operations\n\nThe query builder provides a fluent interface for database operations:\n\n```zig\n// Select with filters\nvar query = try client.from(\"users\")\n    .select(\"id, name, email\")\n    .eq(\"active\", \"true\")\n    .limit(20);\n\n// Insert data\nconst user = JsonValue{ .object = .{\n    .name = \"John Doe\",\n    .email = \"john@example.com\",\n}};\ntry client.batchInsert(\"users\", \u0026[_]JsonValue{user});\n\n// Update data\ntry client.batchUpdate(\"users\", \u0026[_]JsonValue{updated_user});\n\n// Delete data\ntry client.batchDelete(\"users\", \u0026[_][]const u8{\"user_id_1\", \"user_id_2\"});\n```\n\n## Storage Operations\n\n```zig\n// Initialize storage client\nvar storage = try StorageClient.init(allocator, client, \"bucket_name\");\ndefer storage.deinit();\n\n// Upload file\ntry storage.upload(\"path/to/file.txt\", file_data);\n\n// Download file\nconst data = try storage.download(\"path/to/file.txt\");\ndefer allocator.free(data);\n\n// List files\nconst files = try storage.list(null);\ndefer {\n    for (files) |*file| file.deinit(allocator);\n    allocator.free(files);\n}\n```\n\n## Error Handling\n\nThe library uses Zig's error union type for robust error handling:\n\n```zig\nconst result = client.signIn(\"user@example.com\", \"password123\") catch |err| switch (err) {\n    error.AuthError =\u003e handle_auth_error(),\n    error.NetworkError =\u003e handle_network_error(),\n    error.InvalidCredentialsError =\u003e handle_invalid_credentials(),\n    else =\u003e handle_other_error(),\n};\n```\n\n## Memory Management\n\nThis library follows Zig's memory management principles:\n\n- All resources must be explicitly freed using `deinit()`\n- Memory is allocated using the provided allocator\n- No global state or hidden allocations\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\n[Add your chosen license here]","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensvm%2Fsupabase-zig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopensvm%2Fsupabase-zig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensvm%2Fsupabase-zig/lists"}