### Install go-libsql Package Source: https://github.com/tursodatabase/go-libsql/blob/main/README.md Use this command to add the go-libsql library to your Go project. Ensure CGO is enabled for building. ```bash go get github.com/tursodatabase/go-libsql ``` -------------------------------- ### Install cross Source: https://github.com/tursodatabase/go-libsql/blob/main/docs/update_libs.md Install the `cross` tool, a utility for cross-compiling Rust projects. ```bash cargo install cross ``` -------------------------------- ### Connect to LibSQL Database Source: https://github.com/tursodatabase/go-libsql/blob/main/README.md Obtain a `sql.DB` object for use with the `database/sql` package. This example shows how to create a connector for an embedded replica database. ```go dbPath := // Path do db file on local disk primaryUrl := // URL to primary database instance connector := NewEmbeddedReplicaConnector(dbPath, primaryUrl, authToken) db := sql.OpenDB(connector) defer db.Close() ``` -------------------------------- ### Build libsql_experimental for x86_64 Source: https://github.com/tursodatabase/go-libsql/blob/main/docs/update_libs.md Clone the libsql repository and build the libsql_experimental library for the x86_64-unknown-linux-gnu target using `cross`. ```bash git clone https://github.com/tursodatabase/libsql.git cd bindings/c cross build --release --target x86_64-unknown-linux-gnu ``` -------------------------------- ### Build libsql_experimental for aarch64 Source: https://github.com/tursodatabase/go-libsql/blob/main/docs/update_libs.md Build the libsql_experimental library for the aarch64-unknown-linux-gnu target using `cross`. ```bash cross build --release --target aarch64-unknown-linux-gnu ``` -------------------------------- ### Copy compiled library Source: https://github.com/tursodatabase/go-libsql/blob/main/docs/update_libs.md Copy the compiled libsql_experimental static library to the 'libs' directory of the current repository. ```bash libsql/target//release/libsql_experimental.a ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.