{"id":18135388,"url":"https://github.com/grafana/xk6-sql-driver-sqlite3","last_synced_at":"2025-10-27T21:32:08.665Z","repository":{"id":258639518,"uuid":"874293163","full_name":"grafana/xk6-sql-driver-sqlite3","owner":"grafana","description":"xk6-sql driver extension for SQLite v3 database support","archived":false,"fork":false,"pushed_at":"2024-11-05T14:46:29.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-20T03:32:57.523Z","etag":null,"topics":["xk6","xk6-sql-driver"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grafana.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-17T15:13:47.000Z","updated_at":"2024-11-05T14:41:15.000Z","dependencies_parsed_at":"2024-12-20T03:31:53.470Z","dependency_job_id":"06a1ac58-3130-422a-adab-4bace5ca5472","html_url":"https://github.com/grafana/xk6-sql-driver-sqlite3","commit_stats":null,"previous_names":["grafana/xk6-sql-driver-sqlite3"],"tags_count":3,"template":false,"template_full_name":"grafana/xk6-sql-driver-ramsql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fxk6-sql-driver-sqlite3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fxk6-sql-driver-sqlite3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fxk6-sql-driver-sqlite3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fxk6-sql-driver-sqlite3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grafana","download_url":"https://codeload.github.com/grafana/xk6-sql-driver-sqlite3/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238562922,"owners_count":19492971,"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":["xk6","xk6-sql-driver"],"created_at":"2024-11-01T14:07:02.318Z","updated_at":"2025-10-27T21:32:08.265Z","avatar_url":"https://github.com/grafana.png","language":"Go","readme":"# xk6-sql-driver-sqlite3\n\nDatabase driver extension for [xk6-sql](https://github.com/grafana/xk6-sql) k6 extension to support SQLite v3 database.\n\n## Example\n\n```JavaScript file=examples/example.js\nimport sql from \"k6/x/sql\";\nimport driver from \"k6/x/sql/driver/sqlite3\";\n\nconst db = sql.open(driver, \"./test.db\");\n\nexport function setup() {\n  db.exec(`\n    CREATE TABLE IF NOT EXISTS roster\n      (\n        id INTEGER PRIMARY KEY AUTOINCREMENT,\n        given_name VARCHAR NOT NULL,\n        family_name VARCHAR NOT NULL\n      );\n  `);\n}\n\nexport function teardown() {\n  db.close();\n}\n\nexport default function () {\n  let result = db.exec(`\n    INSERT INTO roster\n      (given_name, family_name)\n    VALUES\n      ('Peter', 'Pan'),\n      ('Wendy', 'Darling'),\n      ('Tinker', 'Bell'),\n      ('James', 'Hook');\n  `);\n  console.log(`${result.rowsAffected()} rows inserted`);\n\n  let rows = db.query(\"SELECT * FROM roster WHERE given_name = $1;\", \"Peter\");\n  for (const row of rows) {\n    console.log(`${row.family_name}, ${row.given_name}`);\n  }\n}\n```\n\n## Usage\n\nCheck the [xk6-sql documentation](https://github.com/grafana/xk6-sql) on how to use this database driver.\n\n## Build\n\nSince the sqlite3 driver uses a native shared library, the build requirements are slightly different from other drivers.\n\n**Prerequisites**\n\n- [Go toolchain](https://go101.org/article/go-toolchain.html)\n- 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`.\n- Git\n- Set `CGO_ENABLED=1` in the environment\n\n**Linux**\n\n```bash\nCGO_ENABLED=1 xk6 build --with github.com/grafana/xk6-sql-driver-sqlite3@latest --with github.com/grafana/xk6-sql@latest\n```\n\n**Windows**\n\n```\nset CGO_ENABLED=1\nxk6 build --with github.com/grafana/xk6-sql-driver-sqlite3@latest --with github.com/grafana/xk6-sql@latest\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrafana%2Fxk6-sql-driver-sqlite3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrafana%2Fxk6-sql-driver-sqlite3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrafana%2Fxk6-sql-driver-sqlite3/lists"}