prql icon indicating copy to clipboard operation
prql copied to clipboard

Create a way to test PRQL-generated SQL queries against real databases

Open qorrect opened this issue 4 years ago • 3 comments

qorrect avatar Apr 01 '22 03:04 qorrect

I could also imagine using some commonly used sample table that people use — is there one?

max-sixty avatar Apr 01 '22 03:04 max-sixty

I could also imagine using some commonly used sample table that people use — is there one?

Yes I have found a few:

  • Chinook : https://www.sqlitetutorial.net/sqlite-tutorial/sqlite-sample-database/
  • Northwind : https://docs.yugabyte.com/latest/sample-data/northwind/
  • Employees: ( from @aljazerzen ) https://github.com/vrajmohan/pgsql-sample-data
  • Example Databases: https://dev.mysql.com/doc/index-other.html

I'm starting to make this a docker file that will standup postgres, maria, mysql and run generated queries on them.

Still thinking through how this could be used , rdbunit seems to be a unit testing for SQL queries which we might could use. Maybe have a test suite that generates an rdbu file ( I might modify this so it excepts a json doc ), and then feed that into the docker instance that would run the unit tests and report failure or not.

qorrect avatar Apr 02 '22 19:04 qorrect

That sounds awesome @qorrect ! Will be great to have that working!

max-sixty avatar Apr 02 '22 20:04 max-sixty