diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..3d42a2f --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,40 @@ +{ + "name": "xk6-sql", + "image": "mcr.microsoft.com/devcontainers/base:1-bookworm", + "customizations": { + "vscode": { + "settings": { + "go.lintTool": "golangci-lint", + "go.lintFlags": ["--fast"] + }, + "extensions": [ + "EditorConfig.EditorConfig", + "esbenp.prettier-vscode", + "github.vscode-github-actions", + "github.vscode-pull-request-github", + "jetmartin.bats", + "mads-hartmann.bash-ide-vscode", + "foxundermoon.shell-format" + ] + } + }, + + "features": { + "ghcr.io/devcontainers/features/github-cli:1": {}, + "ghcr.io/devcontainers/features/go:1": { + "version": "1.23", + "golangciLintVersion": "1.63.4" + }, + "ghcr.io/guiyomh/features/goreleaser:0": { "version": "2.6.1" }, + "ghcr.io/michidk/devcontainers-features/bun:1": { "version": "1.2.1" }, + "ghcr.io/szkiba/devcontainer-features/cdo:1": { "version": "0.1.2" }, + "ghcr.io/szkiba/devcontainer-features/mdcode:1": { "version": "0.2.0" }, + "ghcr.io/szkiba/devcontainer-features/bats:1": { "version": "1.11.1" }, + "ghcr.io/grafana/devcontainer-features/xk6:1": { "version": "0.14.0" } + }, + + "remoteEnv": { + "GH_TOKEN": "${localEnv:GH_TOKEN}", + "GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}" + } +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..1913185 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = false +insert_final_newline = true + +[*.{yml,yaml,json,sh,bats}] +indent_size = 2 +trim_trailing_whitespace = true + +[Makefile] +indent_style = tab diff --git a/.gitignore b/.gitignore index 6a840f6..e419f5f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ /k6 /k6.exe -/coverage.out +/coverage.txt /build /node_modules yarn.lock diff --git a/.golangci.yml b/.golangci.yml index b8b20f5..fe94716 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,133 +1,30 @@ -# v1.57.2 -# Please don't remove the first line. It uses in CI to determine the golangci version -run: - timeout: 5m +# v1.63.4 +# Please don't remove the first line. This is a must until the reusable GitHub workflow is refactored. issues: - # Maximum issues count per one linter. Set to 0 to disable. Default is 50. max-issues-per-linter: 0 - # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. max-same-issues: 0 - - # We want to try and improve the comments in the k6 codebase, so individual - # non-golint items from the default exclusion list will gradually be added - # to the exclude-rules below exclude-use-default: false - exclude-rules: - # Exclude duplicate code and function length and complexity checking in test - # files (due to common repeats and long functions in test code) - - path: _(test|gen)\.go - linters: - - cyclop - - dupl - - gocognit - - funlen - - lll - - forcetypeassert - - path: js\/modules\/k6\/html\/.*\.go - text: "exported: exported " - linters: - - revive - - path: js\/modules\/k6\/http\/.*_test\.go - linters: - # k6/http module's tests are quite complex because they often have several nested levels. - # The module is in maintainance mode, so we don't intend to port the tests to a parallel version. - - paralleltest - - tparallel - - linters: - - staticcheck # Tracked in https://github.com/grafana/xk6-grpc/issues/14 - text: "The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated." - - linters: - - forbidigo - text: 'use of `os\.(SyscallError|Signal|Interrupt)` forbidden' - -linters-settings: - exhaustive: - default-signifies-exhaustive: true - cyclop: - max-complexity: 25 - dupl: - threshold: 150 - goconst: - min-len: 10 - min-occurrences: 4 - funlen: - lines: 80 - statements: 60 - forbidigo: - forbid: - - '^(fmt\\.Print(|f|ln)|print|println)$' - # Forbid everything in os, except os.Signal and os.SyscalError - - '^os\.(.*)$(# Using anything except Signal and SyscallError from the os package is forbidden )?' - # Forbid everything in syscall except the uppercase constants - - '^syscall\.[^A-Z_]+$(# Using anything except constants from the syscall package is forbidden )?' - - '^logrus\.Logger$' - linters: - disable-all: true - enable: - - asasalint - - asciicheck - - bidichk - - bodyclose - - contextcheck - - cyclop - - dogsled - - dupl - - durationcheck - - errcheck - - errchkjson - - errname - - errorlint - - exhaustive + enable-all: true + disable: + - wrapcheck + - varnamelen + - exhaustruct - exportloopref - - forbidigo - - forcetypeassert - - funlen - - gocheckcompilerdirectives - - gochecknoglobals - - gocognit - - goconst - - gocritic - - gofmt - - gofumpt - - goimports - - gomoddirectives - - goprintffuncname - - gosec - - gosimple - - govet - - importas - - ineffassign - - interfacebloat - - lll - - makezero - - misspell - - nakedret - - nestif - - nilerr - - nilnil - - noctx - - nolintlint - - nosprintfhostport - - paralleltest - - prealloc - - predeclared - - promlinter - - revive - - reassign - - rowserrcheck - - sqlclosecheck - - staticcheck - - stylecheck - - tenv - - tparallel - - typecheck - - unconvert - - unparam - - unused - - usestdlibvars - - wastedassign - - whitespace - fast: false + - gochecknoinits + - ireturn + +linters-settings: + depguard: + rules: + prevent_accidental_imports: + allow: + - $gostd + - github.com/brianvoe/gofakeit/v6 + - github.com/stretchr/testify/require + - github.com/grafana/sobek + - github.com/grafana/k6 + - github.com/grafana/xk6-sql + - github.com/proullon/ramsql/driver diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fd01915..e671c83 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,24 +1,55 @@ # Contributing Guidelines -Thank you for your interest in contributing to **xk6-sql**! +Thank you for your interest in contributing! + +All types of contributions are encouraged and valued. Please make sure to read this document before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. + +> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about: +> - Star the project +> - Tweet about it +> - Refer this project in your project's readme +> - Mention the project at local meetups and tell your friends/colleagues + +## Code of Conduct Before you begin, make sure to familiarize yourself with the [Code of Conduct](CODE_OF_CONDUCT.md). If you've previously contributed to other open source project, you may recognize it as the classic [Contributor Covenant](https://contributor-covenant.org/). -If you want to chat with the team or the community, you can [join our community forums](https://community.grafana.com/c/grafana-k6). +## Asking questions + +Before you ask a question, it is best to search for existing [Issues](https://github.com/grafana/xk6-sql/issues) that might help you. It is also advisable to search the internet for answers first. + +If you then still feel the need to ask a question and need clarification or if you want to chat with the team or the community, you can [join our community forums](https://community.grafana.com/c/grafana-k6). -### Filing issues +## Reporting Bugs -Don't be afraid to file issues! Nobody can fix a bug we don't know exists, or add a feature we didn't think of. +A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. -The worst that can happen is that someone closes it and points you in the right direction. +We use [GitHub issues](https://github.com/grafana/xk6-sql/issues) to track bugs and errors. If you run into an issue with the project: -That said, "how do I..."-type questions are often more suited for [community forums](https://community.grafana.com/c/grafana-k6). +- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error. +- Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue. +- Open an [Issue](https://github.com/grafana/xk6-sql/issues). +- Explain the behavior you would expect and the actual behavior. +- Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. -### Contributing code +## Suggesting Enhancements + +Enhancement suggestions are tracked as [GitHub issues](https://github.com/grafana/xk6-sql/issues). + +- Make sure that you are using the latest version. +- Read the documentation carefully and find out if the functionality is already covered, maybe by an individual configuration. +- Perform a search in [Issues](https://github.com/grafana/xk6-sql/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. +- Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. +- Use a **clear and descriptive title** for the issue to identify the suggestion. +- Provide a **step-by-step description of the suggested enhancement** in as many details as possible. +- **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you. +- **Explain why this enhancement would be useful** to most of users. You may also want to point out the other projects that solved it better and which could serve as inspiration. + +## Contributing code If you'd like to contribute code, this is the basic procedure. -1. Find an issue you'd like to fix. If there is none already, or you'd like to add a feature, please open one, and we can talk about how to do it. Out of respect for your time, please start a discussion regarding any bigger contributions either in a GitHub Issue, in the community forums **before** you get started on the implementation. +1. Find an [issue](https://github.com/grafana/xk6-sql/issues) you'd like to fix. If there is none already, or you'd like to add a feature, please open one, and we can talk about how to do it. Out of respect for your time, please start a discussion regarding any bigger contributions either in a [GitHub Issue](https://github.com/grafana/xk6-sql/issues), in the community forums **before** you get started on the implementation. Remember, there's more to software development than code; if it's not properly planned, stuff gets messy real fast. @@ -28,74 +59,58 @@ If you'd like to contribute code, this is the basic procedure. 4. We will discuss implementation details until everyone is happy, then a maintainer will merge it. -## Prerequisites +## Development Environment -Prerequisites are listed in the [tools] section in addition to the [go toolchain](https://go101.org/article/go-toolchain.html) and [git](https://git-scm.com/) CLI. +We use [Development Containers](https://containers.dev/) to provide a reproducible development environment. We recommend that you do the same. In this way, it is guaranteed that the appropriate version of the tools required for development will be available. -### Special cases +**Without installing software** -If the database driver uses shared library, 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`. +You can *contribute without installing any software* using [GitHub Codespaces](https://docs.github.com/en/codespaces). After forking the repository, [create a codespace for your repository](https://docs.github.com/en/codespaces/developing-in-a-codespace/creating-a-codespace-for-a-repository). -The `Makefile` is generated from the task list defined in the `CONTRIBUTING.md` file using the [cdo] tool. If the contribution is made to the task list, the `Makefile` must be regenerated, which is why the [cdo] tool is needed. The [cdo] tool can most conveniently be installed using the [eget] tool. +**Using an IDE** -```bash -eget szkiba/cdo -``` +You can contribute conveniently using [Visual Studio Code](https://code.visualstudio.com/) by installing the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension. You *don't need to install any other software* to contribute. Clone your repository and open the folder with Visual Studio Code. It will automatically detect that the folder contains a Dev Container configuration and ask you whether to open the folder in a container. Choose **"Reopen in Container"**. -[cdo]: https://github.com/szkiba/cdo -[eget]: https://github.com/zyedidia/eget +[JetBrains GoLand](https://www.jetbrains.com/help/go/connect-to-devcontainer.html) also has DevContainers support. -## Tasks +It is worth mentioning [DevPod](https://devpod.sh/docs/) in addition to the above. -The tasks defined here can be executed manually or conveniently using the make or [cdo] tool. +**The hard way** -**Help about tasks** +All the tools used for development are free and open-source, so you can install them without using *Development Containers*. The `.devcontainer/devcontainer.json` file contains a list of the tools to be installed and their version numbers. -The command below lists the possible tasks. +### Updating tool versions -using make: +The version numbers of tools used in GitHub workflows are defined as [repository variables](https://github.com/grafana/xk6-sql/settings/variables/actions). The version numbers of tools used in the *Development Containers* are only defined in the `.devcontainer/devcontainer.json` file. The version numbers should be updated carefully to be consistent. -```bash -make -``` +## Tasks -using [cdo]: +The usual contributor tasks can be performed using GNU make. The `Makefile` defines a target for each task. To execute a task, the name of the task must be specified as an argument to the make command. ```bash -cdo +make taskname ``` -**Execute task** - -Tasks are executed by passing the name of the task as a parameter. - -using make: +Help on the available targets and their descriptions can be obtained by issuing the `make` command without any arguments. ```bash -make taskname +make ``` -using [cdo]: +More detailed help can be obtained for individual tasks using the [cdo](https://github.com/szkiba/cdo) command: ```bash -cdo taskname +cdo taskname --help ``` -### tools - Install the required tools +**Authoring the Makefile** -Contributing will require the use of some tools, which can be installed most easily with a well-configured [eget] tool. +The `Makefile` is generated from the task list defined in the `CONTRIBUTING.md` file using the [cdo](https://github.com/szkiba/cdo) tool. If a contribution has been made to the task list, the `Makefile` must be regenerated using the [makefile] target. ```bash -eget szkiba/mdcode -eget -t 1.57.2 golangci/golangci-lint -go install go.k6.io/xk6/cmd/xk6@latest +make makefile ``` -[tools]: #tools---install-the-required-tools -[xk6]: https://github.com/grafana/xk6 -[mdcode]: https://github.com/szkiba/mdcode -[golangci-lint]: https://github.com/golangci/golangci-lint - ### lint - Run the linter The [golangci-lint] tool is used for static analysis of the source code. It is advisable to run it before committing the changes. @@ -104,12 +119,14 @@ The [golangci-lint] tool is used for static analysis of the source code. It is a golangci-lint run ``` +[golangci-lint]: https://github.com/golangci/golangci-lint + ### test - Run the tests The `go test` command is used to run the tests and generate the coverage report. ```bash -go test -count 1 -race -coverprofile=coverage.out -timeout 60s ./... +go test -count 1 -race -coverprofile=coverage.txt -timeout 60s ./... ``` [test]: <#test---run-the-tests> @@ -122,7 +139,7 @@ Requires : [test] ```bash -go tool cover -html=coverage.out +go tool cover -html=coverage.txt ``` ### build - Build custom k6 with extension @@ -133,16 +150,19 @@ The [xk6] tool is used to build the k6. In addition to the xk6-sql extension, th xk6 build --with github.com/grafana/xk6-sql=. --with github.com/grafana/xk6-sql-driver-ramsql ``` +[xk6]: https://github.com/grafana/xk6 [build]: <#build---build-custom-k6-with-extension> -### example - Run the example +### example - Run the examples -Run the example embedded in `README.md` and save the output. +Run the examples embedded in `README.md`. ```bash -./k6 run examples/example.js > examples/example.txt 2>&1 +bats ./examples ``` +[example]: #example---run-the-examples + ### readme - Update README.md Update the example code and its output in `README.md` using [mdcode] tool. @@ -151,22 +171,34 @@ Update the example code and its output in `README.md` using [mdcode] tool. mdcode update ``` +[mdcode]: + ### clean - Clean the working directory Delete the work files created in the work directory (also included in .gitignore). ```bash -rm -f ./k6 +rm -rf ./k6 ./coverage.txt ./build ./node_modules ./bun.lockb ``` [clean]: #clean---clean-the-working-directory +### doc - Generate API documentation + +Generate API documentation using `typedoc`. The generated documentation will be placed in the `build/docs` folder. + +```bash +bun x typedoc --out build/docs +``` + +[doc]: #doc---generate-api-documentation + ### all - Clean build Performs the most important tasks. It can be used to check whether the CI workflow will run successfully. Requires -: [clean], [format], [test], [build] +: [clean], [format], [test], [build], [doc] ### format - Format the go source codes @@ -181,3 +213,4 @@ go fmt ./... ```bash cdo --makefile Makefile ``` +[makefile]: <#makefile---generate-the-makefile> \ No newline at end of file diff --git a/Makefile b/Makefile index c913976..0a6069e 100644 --- a/Makefile +++ b/Makefile @@ -12,17 +12,17 @@ __help__: @echo ' build Build custom k6 with extension' @echo ' clean Clean the working directory' @echo ' coverage View the test coverage report' - @echo ' example Run the example' + @echo ' doc Generate API documentation' + @echo ' example Run the examples' @echo ' format Format the go source codes' @echo ' lint Run the linter' @echo ' makefile Generate the Makefile' @echo ' readme Update README.md' @echo ' test Run the tests' - @echo ' tools Install the required tools' # Clean build .PHONY: all -all: clean format test build +all: clean format test build doc # Build custom k6 with extension .PHONY: build @@ -35,21 +35,28 @@ build: .PHONY: clean clean: @(\ - rm -f ./k6;\ + rm -rf ./k6 ./coverage.txt ./build ./node_modules ./bun.lockb;\ ) # View the test coverage report .PHONY: coverage coverage: test @(\ - go tool cover -html=coverage.out;\ + go tool cover -html=coverage.txt;\ ) -# Run the example +# Generate API documentation +.PHONY: doc +doc: + @(\ + bun x typedoc --out build/docs;\ + ) + +# Run the examples .PHONY: example example: @(\ - ./k6 run examples/example.js > examples/example.txt 2>&1;\ + bats ./examples;\ ) # Format the go source codes @@ -84,15 +91,6 @@ readme: .PHONY: test test: @(\ - go test -count 1 -race -coverprofile=coverage.out -timeout 60s ./...;\ - ) - -# Install the required tools -.PHONY: tools -tools: - @(\ - eget szkiba/mdcode;\ - eget -t 1.57.2 golangci/golangci-lint;\ - go install go.k6.io/xk6/cmd/xk6@latest;\ + go test -count 1 -race -coverprofile=coverage.txt -timeout 60s ./...;\ ) diff --git a/README.md b/README.md index b44ea00..e9e7345 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,24 @@ xk6-sql is a [Grafana k6 extension](https://grafana.com/docs/k6/latest/extensions/) that enables the use of SQL databases in [k6](https://grafana.com/docs/k6/latest/) tests. +Check out the API documentation [here](https://sql.x.k6.io). The TypeScript declaration file can be downloaded from [here](https://sql.x.k6.io/index.d.ts). + +> [!NOTE] +> To use the TypeScript declaration file in your IDE (e.g. Visual Studio Code), you need to create a `jsconfig.json` (or `tsconfig.json`) file with the following content: +> +> ```json file=examples/jsconfig.json +> { +> "compilerOptions": { +> "target": "ES6", +> "module": "ES6", +> "paths": { +> "k6/x/sql": ["./typings/xk6-sql/index.d.ts"] +> } +> } +>} +>``` +> You will need to update the TypeScript declaration file location in the example above to where you downloaded it. + ## Usage To use the xk6-sql API, the `k6/x/sql` module and the driver module corresponding to the database type should be imported. In the example below, `k6/x/sql/driver/ramsql` is the RamSQL database driver module. diff --git a/examples/example.txt b/examples/example.txt index 30a7045..45e95ff 100644 --- a/examples/example.txt +++ b/examples/example.txt @@ -12,13 +12,13 @@ scenarios: (100.00%) 1 scenario, 1 max VUs, 10m30s max duration (incl. graceful stop): * default: 1 iterations for each of 1 VUs (maxDuration: 10m0s, gracefulStop: 30s) -time="2024-10-21T15:47:50+02:00" level=info msg="4 rows inserted" source=console -time="2024-10-21T15:47:50+02:00" level=info msg="Pan, Peter" source=console +time="2025-02-11T18:28:31Z" level=info msg="4 rows inserted" source=console +time="2025-02-11T18:28:31Z" level=info msg="Pan, Peter" source=console data_received........: 0 B 0 B/s data_sent............: 0 B 0 B/s - iteration_duration...: avg=371.25µs min=371.25µs med=371.25µs max=371.25µs p(90)=371.25µs p(95)=371.25µs - iterations...........: 1 1061.969082/s + iteration_duration...: avg=700.95µs min=700.95µs med=700.95µs max=700.95µs p(90)=700.95µs p(95)=700.95µs + iterations...........: 1 409.636452/s running (00m00.0s), 0/1 VUs, 1 complete and 0 interrupted iterations diff --git a/examples/examples.bats b/examples/examples.bats new file mode 100644 index 0000000..d9aa6e2 --- /dev/null +++ b/examples/examples.bats @@ -0,0 +1,20 @@ +#!/usr/bin/env bats + +setup() { + cd "$BATS_TEST_DIRNAME" + BASEDIR="$(git rev-parse --show-toplevel)" + EXE="$BASEDIR/k6" + + if [ ! -x "$EXE" ]; then + echo " - building k6" >&3 + cd "$BASEDIR" + xk6 build --with github.com/grafana/xk6-sql=. --with github.com/grafana/xk6-sql-driver-ramsql + cd "$BATS_TEST_DIRNAME" + fi +} + +@test 'example.js' { + $EXE run examples/example.js >examples/example.txt 2>&1 + [ $? -eq 0 ] + grep -q 'msg="Pan, Peter"' examples/example.txt +} diff --git a/examples/jsconfig.json b/examples/jsconfig.json new file mode 100644 index 0000000..fce89e7 --- /dev/null +++ b/examples/jsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "target": "ES6", + "module": "ES6", + "paths": { + "k6/x/sql": ["./typings/xk6-sql/index.d.ts"] + } + } +} diff --git a/register_test.go b/register_internal_test.go similarity index 100% rename from register_test.go rename to register_internal_test.go diff --git a/releases/v1.0.2.md b/releases/v1.0.2.md new file mode 100644 index 0000000..29e6095 --- /dev/null +++ b/releases/v1.0.2.md @@ -0,0 +1,8 @@ +xk6-sql `v1.0.2` is here 🎉! + +This release includes: + +This is a maintenance release, changes: + +- Simplify contribution with support for reproducible development environments ([Development Containers](https://containers.dev/)). +- Updated documentation for typings to work with VSCode diff --git a/sql/module.go b/sql/module.go index 572d90c..c618409 100644 --- a/sql/module.go +++ b/sql/module.go @@ -84,6 +84,7 @@ func (dbase *Database) Query(query string, args ...interface{}) ([]KeyValue, err defer func() { _ = rows.Close() }() + if rows.Err() != nil { return nil, rows.Err() } @@ -111,6 +112,7 @@ func (dbase *Database) Query(query string, args ...interface{}) ([]KeyValue, err for i, colName := range cols { data[colName] = *valuePtrs[i].(*interface{}) //nolint:forcetypeassert } + result = append(result, data) } diff --git a/sql/module_test.go b/sql/module_test.go index 2cec5f2..472355b 100644 --- a/sql/module_test.go +++ b/sql/module_test.go @@ -6,7 +6,6 @@ import ( "github.com/grafana/xk6-sql/sql" "github.com/grafana/xk6-sql/sqltest" - _ "github.com/proullon/ramsql/driver" ) diff --git a/sql/sql_internal_test.go b/sql/sql_internal_test.go index 05765a5..ee3ceb0 100644 --- a/sql/sql_internal_test.go +++ b/sql/sql_internal_test.go @@ -8,7 +8,9 @@ import ( ) func TestOpen(t *testing.T) { //nolint: paralleltest - mod := New().NewModuleInstance(nil).(*module) + mod, ok := New().NewModuleInstance(nil).(*module) + + require.True(t, ok) driver := RegisterDriver("ramsql") require.NotNil(t, driver) diff --git a/sqltest/sqltest_test.go b/sqltest/sqltest_test.go index d29e4de..72e6c86 100644 --- a/sqltest/sqltest_test.go +++ b/sqltest/sqltest_test.go @@ -6,7 +6,6 @@ import ( "github.com/grafana/xk6-sql/sql" "github.com/grafana/xk6-sql/sqltest" - _ "github.com/proullon/ramsql/driver" ) diff --git a/tsconfig.json b/tsconfig.json index 6bfdd45..a5b9ee2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,11 +18,13 @@ } }, "compilerOptions": { - "target": "es6", - "module": "commonjs", + "target": "ES6", + "module": "ES6", + "paths": { + "k6/x/sql": ["./index.d.ts"] + }, "esModuleInterop": true, "strict": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true + "forceConsistentCasingInFileNames": true } }