{"id":19293684,"url":"https://github.com/tursodatabase/go-libsql","last_synced_at":"2025-04-04T15:07:06.091Z","repository":{"id":191636919,"uuid":"684627457","full_name":"tursodatabase/go-libsql","owner":"tursodatabase","description":"libSQL API for Go","archived":false,"fork":false,"pushed_at":"2025-03-13T10:06:21.000Z","size":369256,"stargazers_count":158,"open_issues_count":21,"forks_count":23,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-03-28T14:05:33.504Z","etag":null,"topics":["go","libsql","sqlite"],"latest_commit_sha":null,"homepage":"","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/tursodatabase.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":"2023-08-29T14:24:15.000Z","updated_at":"2025-03-27T21:58:46.000Z","dependencies_parsed_at":"2023-08-30T21:55:08.121Z","dependency_job_id":"38dcf2d2-7965-4928-a46c-fec84eb95167","html_url":"https://github.com/tursodatabase/go-libsql","commit_stats":null,"previous_names":["libsql/go-libsql"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tursodatabase%2Fgo-libsql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tursodatabase%2Fgo-libsql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tursodatabase%2Fgo-libsql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tursodatabase%2Fgo-libsql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tursodatabase","download_url":"https://codeload.github.com/tursodatabase/go-libsql/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198445,"owners_count":20900079,"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":["go","libsql","sqlite"],"created_at":"2024-11-09T22:35:47.592Z","updated_at":"2025-04-04T15:07:06.073Z","avatar_url":"https://github.com/tursodatabase.png","language":"Go","readme":"# LibSQL package for Go\n\n[libSQL](https://github.com/tursodatabase/libsql) is an open source, open contribution fork of SQLite.\nThis source repository contains libSQL API bindings for Go.\n\n## Notice\nThis package comes with a precompiled native libraries.\nCurrently only `linux amd64`, `linux arm64`, `darwin amd64` and `darwin arm64` are supported.\nWe're working on adding support for more platforms.\n\n## Features\n\n* In-memory databases and local database files, like SQLite\n* Remote database access to libSQL server\n* In-app replica that syncs with a libSQL server\n\n## Installing\n\n```\ngo get github.com/tursodatabase/go-libsql\n```\n\n`go-libsql` uses `CGO` to make calls to LibSQL. You must build your binaries with `CGO_ENABLED=1`.\n\n## Getting Started\n\n### Connecting to the database\n\nTo connect to the database one needs to create a `libsql.Connector` using one of the factory functions: `libsql.NewEmbeddedReplicaConnector` or `libsql.NewEmbeddedReplicaConnectorWithAutoSync`.\n\nHere's an example of obtaining a `sql.DB` object from `database/sql` package:\n\n```\ndbPath := // Path do db file on local disk\nprimaryUrl := // URL to primary database instance\nconnector := NewEmbeddedReplicaConnector(dbPath, primaryUrl, authToken)\ndb := sql.OpenDB(connector)\ndefer db.Close()\n```\n\nOnce `sql.DB` object is created one can use it as any other database that supports `database/sql` package.\n\n### Fetching updates from primary database instance\n\nIf the connector is created with `libsql.NewEmbeddedReplicaConnectorWithAutoSync` then it will automatically fetch updates from a primary periodically.\n\nFor connectors created with `libsql.NewEmbeddedReplicaConnector` we need to fetch updates manually by calling `connector.Sync`\n\n## Examples\n\nModule with usage examples can be found in [example directory].\n\n## License\n\nThis project is licensed under the [MIT license].\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in libSQL by you, shall be licensed as MIT, without any additional\nterms or conditions.\n\n[MIT license]: https://github.com/tursodatabase/go-libsql/blob/main/LICENSE\n[example directory]: https://github.com/tursodatabase/go-libsql/tree/main/example\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftursodatabase%2Fgo-libsql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftursodatabase%2Fgo-libsql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftursodatabase%2Fgo-libsql/lists"}