go-sqltest

module
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2025 License: Apache-2.0

README

go-sqltest

GitHub tag (latest SemVer) test Go Reference codecov

The go-sqltest is a scenario test framework for SQL-compatible databases. The go-sqltest imports the scenario test files and runs the scenario test to the target SQL-compatible databases as the following.

The scenario testing framework will be used in my SQL-compatible database projects such as go-mysql.

Client

The go-sqltest is implemented using Go and uses standard generic database/sql interfaces, mainly SQL (or SQL-like) databases for clients. Therefore, go-sqltest can run scenario tests against a variety of SQL databases such as MySQL and PostgreSQL by providing drivers for the database/sql interface.

Adding scenario tests

The go-sqltest imports a scenario test file in the test directory and embeds the file in the helper test function. The scenario test file must have the extension qst (query scenario test).

Scenario File Format

A scenario test consists of a combination of a query and an expected response; the EBNF specification is as follows.

scenario-test = (query, response)*
query = SQL
response = JSON response

Directories

Path Synopsis
cmd
sqltest
nolint: forbidigo
nolint: forbidigo
sqltest is a scenario testing framework for evaluating MySQL compatibility.
sqltest is a scenario testing framework for evaluating MySQL compatibility.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL