Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Here you go. #6

Merged
2 commits merged into from
Dec 19, 2010
Merged

Here you go. #6

2 commits merged into from
Dec 19, 2010

Conversation

JulianBirch
Copy link
Contributor

I thought I should document what I've done and why.

In client integration tests, helper.client now automatically adds a handler to client.on 'error'. This means that connection problems and other unexpected errors get printed out. It also means that the tests don't crash out the moment they hit an incorrect SQL syntax. Next, I did the same thing to client.query. This enabled me to actually see what errors I was getting, which revealed that (no real surprise here) "Relation person did not exist".

It's then that I found the comment "Make sure you run the script create-test-tables". :) So, reading the documentation correctly would have saved me a lot of hassle.

After doing that, I finally had 25 != 26 like we discussed last night. I've left these changes to the tests in because I think it's easier for someone to debug when they start out this way. Oh yes, it also prints out the test names. Your mileage may vary :)

I changed the query to select name from person order by name, simply because I had some (SQL Server) code recently that assumed the order by, which broke after a year in production. Wasn't very funny...

So finally I got around to reproducing my issue, which it turns out was harder than I thought. The basic problem was that it broke eyes, which isn't very testable. Instead, I went for the fact that iterating through the columns and calling "length" doesn't agree. Of course, if you use Object instead of Array, there isn't a length property anyway, but I think it might also be possible to get confused if there actually was a column called 'length'.

@brianc
Copy link
Owner

brianc commented Dec 19, 2010

Thanks mucho. Soon after we discussed this yesterday I was building out postgres-session and noticed exactly what you were talking about. It all made sense, and thanks again for the patches.

brianc added a commit that referenced this pull request Dec 18, 2019
brianc added a commit that referenced this pull request Dec 27, 2019
Accept a `log: (message, other...) => { }` parameter as a config option, but by default use a no-op function instead of debug.
brianc pushed a commit that referenced this pull request Apr 28, 2020
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants