The litesync/go-sqlite3 wrapper allows Go programs to interface with the pre-installed LiteSync library.


First follow the instructions to compile and install LiteSync from the source code or use the pre-compiled binaries for your platform. You can start with the free version.

Then download the wrapper using this command:

go get github.com/litesync/go-sqlite3

Note: The wrapper uses the already installed SQLite library containing LiteSync. So it must be present on the device.

For more information check the instructions at the go-sqlite3 repository.

Example code
package main

import (
  _ "github.com/litesync/go-sqlite3"

func main() {
  db, err := sql.Open("sqlite3", "file:test.db?node=secondary&connect=tcp://")
  if err != nil {
    println("failed to open the database: " + err.Error())

  // wait until the db is ready
  for !db.IsReady() {
    time.Sleep(1000 * time.Millisecond)

  // now we can access the db
  println("OK, ready!")

Check also the go-sqlite3 usage examples