Does the use case for this maybe depend on your application language and testing facilities? We are comfortable writing sql where it offers an advantage over the alternative, but I can't see what benefit PgTAP offers for our situation (but very willing to be persuaded). We have a rails app backed by postgres. We routinely write database migrations in sql (activerecord doesn't seem to offer much advantage here), and w…
PgTAP: Unit Testing for PostgreSQL
11–20 of 22 posts
Re: PgTAP: Unit Testing for PostgreSQL
#12Does the use case for this maybe depend on your application language and testing facilities? We are comfortable writing sql where it offers an advantage over the alternative, but I can't see what benefit PgTAP offers for our situation (but very willing to be persuaded). We have a rails app backed by postgres. We routinely write database migrations in sql (activerecord doesn't seem to offer much advantage here), and w…
Re: PgTAP: Unit Testing for PostgreSQL
#13Re: PgTAP: Unit Testing for PostgreSQL
#14I was at Etsy when this was being built by a consultant, ostensibly for us to use to test our morass of stored procedures in perpetuity. Early on, someone got some bad advice and thought you were safe from sql injection if you wrote your sql inside stored procedures. This misconception got wildly out of hand. We stopped writing sprocs and migrated to MySQL over many years instead. I'm happy with the decision. The dat…
Re: PgTAP: Unit Testing for PostgreSQL
#15TAP is great, with tape, PgTAP, Test::More, we have a cross method for testing.
Btw, on JavaScript context I use accidentally mocha+should, not tape, just cause I discovered tape later ... but it is ok, cause TIMTOWTDI.
Re: PgTAP: Unit Testing for PostgreSQL
#16You may be interested in this: https://github.com/rubyworks/tapout/wiki/TAP-Y-J-Specificati...
Re: PgTAP: Unit Testing for PostgreSQL
#17Does the use case for this maybe depend on your application language and testing facilities? We are comfortable writing sql where it offers an advantage over the alternative, but I can't see what benefit PgTAP offers for our situation (but very willing to be persuaded). We have a rails app backed by postgres. We routinely write database migrations in sql (activerecord doesn't seem to offer much advantage here), and w…
Re: PgTAP: Unit Testing for PostgreSQL
#18I was at Etsy when this was being built by a consultant, ostensibly for us to use to test our morass of stored procedures in perpetuity. Early on, someone got some bad advice and thought you were safe from sql injection if you wrote your sql inside stored procedures. This misconception got wildly out of hand. We stopped writing sprocs and migrated to MySQL over many years instead. I'm happy with the decision. The dat…
I'll probably never understand why people believe that a stored proc is not subject to injection attacks. Like they're magic or something.
If you concatenate unsanitized input you are susceptible no matter where you write the SQL.
Re: PgTAP: Unit Testing for PostgreSQL
#19Earlier quoted context omitted.
I'll probably never understand why people believe that a stored proc is not subject to injection attacks. Like they're magic or something.
Because if you use the input parameters correctly they are immune to injection. If you concatenate unsanitized input you are susceptible no matter where you write the SQL.
Re: PgTAP: Unit Testing for PostgreSQL
#20Earlier quoted context omitted.
I'll probably never understand why people believe that a stored proc is not subject to injection attacks. Like they're magic or something.
Because if you use the input parameters correctly they are immune to injection. If you concatenate unsanitized input you are susceptible no matter where you write the SQL.