diff --git a/README.md b/README.md index 3c8a99b..69e944e 100644 --- a/README.md +++ b/README.md @@ -34,3 +34,30 @@ export default function () { ## Usage Check the [xk6-sql documentation](https://github.com/grafana/xk6-sql) on how to use this database driver. + +## Build + +Since the sqlite3 driver uses a native shared library, the build requirements are slightly different from other drivers. + +**Prerequisites** + +- [Go toolchain](https://go101.org/article/go-toolchain.html) +- A build toolchain for your system that includes `gcc` or + another C compiler. On Debian and derivatives install the `build-essential` + package. On Windows you can use [tdm-gcc](https://jmeubank.github.io/tdm-gcc/). + Make sure that `gcc` is in your `PATH`. +- Git +- Set `CGO_ENABLED=1` in the environment + +**Linux** + +```bash +CGO_ENABLED=1 xk6 build --with github.com/grafana/xk6-sql-driver-sqlite3 --with github.com/grafana/xk6-sql@latest +``` + +**Windows** + +``` +set CGO_ENABLED=1 +xk6 build --with github.com/grafana/xk6-sql-driver-sqlite3 --with github.com/grafana/xk6-sql@latest +```