From 3c5696976992d3f1ba52cf8f17997e3da42e6b84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20SZKIBA?= Date: Fri, 18 Oct 2024 11:52:34 +0200 Subject: [PATCH] docs: added prerequisites section --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) 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 +```