grafana / xk6-sql

k6 extension to load test RDBMSs (PostgreSQL, MySQL, MS SQL and SQLite3)
Apache License 2.0
108 stars 57 forks source link

Allow Query() to accept parameterized SQL values #6

Closed zacharyvoase closed 3 years ago

zacharyvoase commented 3 years ago

This way we can benefit from Go's built-in SQL escaping routines without having to do DB-specific string escaping in the load testing script itself.

imiric commented 3 years ago

Hey, thanks for this!

LGTM, but could you add a usage example of it in the tests/ directory? Just for SQLite would be fine.

I'd like to eventually turn these into proper tests and hook up CI here, but well, priorities :)

zacharyvoase commented 3 years ago

Done, I added it for all three examples (I'm currently using it successfully with postgres, actually).

zacharyvoase commented 3 years ago

Thank you so much!