๐ Feature description
Our Postgres assertions can only validate exact queries.
So, for example, you can validate that a query like INSERT INTO users(email) VALUES ([email protected])
.
The downside of this is that you need to specify the exact query that was made on the database.
But usually, you don't really want to validate the entire query syntax, you just want to validate that some fields were added to the table, but you don't care about the others.
This feature should allow writing an assertion like
expectTrace(traceloop)
.toQueryPostgresSQL()
.withPartialQuery(
`INSERT INTO users(email) VALUES ([email protected])`
And it will succeed even if the actual query was
INSERT INTO users(name, request_id, email) VALUES (bla, 5934345, [email protected])
๐ค Why is this feature needed ?
Our goal with this project is to make end-to-end tests easier. Being able to write simple assertions Is core to this.
โ๏ธ How do you aim to achieve this?
We will need to use some Typescript SQL parser to parse and compare the asserted and actual SQL queries.
๐๏ธ Additional Information
No response
๐ Have you spent some time to check if this feature request has been raised before?
Are you willing to submit PR?
None