Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add database support #1019

Closed
ayaka209 opened this issue May 14, 2019 · 8 comments
Closed

Add database support #1019

ayaka209 opened this issue May 14, 2019 · 8 comments
Labels
evaluation needed proposal needs to be validated or tested before fully implementing it in k6 feature help wanted

Comments

@ayaka209
Copy link

There are many npm database client but they can't be browserified, some used tcp, some used binaries. so we can't use sqlite, mysql, ... in k6.

please add support for database, or add more support for these npm package

@na-- na-- added evaluation needed proposal needs to be validated or tested before fully implementing it in k6 feature help wanted labels May 14, 2019
@na-- na-- changed the title [Feature request] Add database support Add database support May 14, 2019
@na--
Copy link
Member

na-- commented May 14, 2019

Thanks for opening this issue! We'd like to support database connections - both so that data for the load test could be retrieved from them, but also because we'd like to be able to actually load test databases.

The actual DB connection handling, query execution and measurement (for the load testing) should likely be handled in Go, for performance reasons and because there are nice abstractions and a lot of available drivers (1, 2) that use them. Unfortunately, I can't give an accurate estimation on when we'll get to implementing DB support, since we have quite a lot of other important things in our roadmap. But we'll likely accept quality pull requests for something like this, so if anyone is interested on working on it, feel free to reach out in this issue.

@paralectvkomodey
Copy link

Hi! Any progress on that?

@mostafa
Copy link
Member

mostafa commented Jul 21, 2020

Hi @ayaka209 and @paralectvkomodey,

I've written a very basic plugin for load testing SQL databases, mainly PostgreSQL, MySQL and SQLite: k6-plugin-sql. It can also be used to read data from or insert data into database in setup/teardown functions.

The plugin system is not merged yet, but you can play with it: #1353 and #1396.

The instructions are available on Build k6 from source (with plugin support PR), though you still need to fix conflicts before being able to use k6 with plugin support on the master branch. Otherwise, you can use the v0.26.2 tag, which I don't recommend.

Also, we'd be happy to hear your feedback.

@SpokeyWheeler
Copy link

+1 for moving this forward :-)

@paul-ovchinnikov
Copy link

Hi! Any progress on that?)

@na--
Copy link
Member

na-- commented Apr 22, 2021

We don't have support for databases in the k6 core yet, but since we introduced xk6 Go extensions in k6 v0.29.0, there have been a number of DB extensions. More details:

Some unofficial k6 DB extensions:

@mstoykov
Copy link
Contributor

Additionally there is currently experimental redis support in k6.

@oleiade
Copy link
Member

oleiade commented Dec 4, 2023

As we have no immediate plan to add native support for database interactions to k6 on our current roadmap, the maintainers' team decided to close this issue in favor of a more specific one.

We invite users looking to interact with SQL and NOSQL databases to turn to the xk6 extensions mentioned 👆and listed on our extensions page.

@oleiade oleiade closed this as completed Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
evaluation needed proposal needs to be validated or tested before fully implementing it in k6 feature help wanted
Projects
None yet
Development

No branches or pull requests

8 participants