Skip to content

Would you like to pull my changes? #20

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

Merged
merged 42 commits into from
Nov 28, 2011
Merged

Would you like to pull my changes? #20

merged 42 commits into from
Nov 28, 2011

Conversation

AlexanderS
Copy link
Contributor

Hi,
I do not know if my code is good enough for you. Until now I had no time to implement tests or something like that. The binary and text protocol can be changed with the binary attribute in the query.

Let me know, if you want me to add or change something before merge.

Thanks,
Alex

@brianc
Copy link
Owner

brianc commented Mar 11, 2011

I've been watching your repo for a while. I'm excited about the work you've done; however, I cannot merge this in without automated testing to prove it works & support future development. I would like to merge this, but please write tests covering the code. Once I get the libpq bindings in place I'll probably have time to help you out with writing tests. It would be good to support the binary protocol in both the libpq bindings as well as the pure javascript client.

Alternatively you can look at a way to run the existing integration tests but have them all use the binary protocol instead of text protocol via a command line switch. I've done something similar with the recent addition of libpq bindings. I did write a few new tests for the libpq bindings, but most of the testing was performed by having the existing integration tests retrofitted to require the native libpq bindings rather than the pure javascript driver. This way I can test both forms of the library adhere to the same interface and emit the same events.

tl; dr - I really like this, but I cannot accept a patch without tests as it violates one of the foundational concepts of node-postgres.

@AlexanderS
Copy link
Contributor Author

Hi,
now I added some tests...

Thanks

@brianc
Copy link
Owner

brianc commented Jun 21, 2011

Thanks @AlexanderS! Could you sync up your branch to the current master branch of my repository by merging them together & then send me a pull request with the merged code?

Conflicts:
	lib/query.js
	test/unit/client/typed-query-results-tests.js
@AlexanderS
Copy link
Contributor Author

Merged my code with your master.

@brianc
Copy link
Owner

brianc commented Jul 10, 2011

When I check out your branch & run the tests it fails. Are all of the tests passing for you?

Example: https://gist.github.com/1074819

@AlexanderS
Copy link
Contributor Author

Fixed it. That was just a rename of the getStringTypeParser function...

@brianc
Copy link
Owner

brianc commented Jul 13, 2011

Do all of the tests pass for?

make test-all ?

When I run that command I get a failure on one of the very first integration tests.

Conflicts:
	lib/query.js
	lib/types.js
	test/unit/client/query-tests.js
	test/unit/client/typed-query-results-tests.js
some textParsers requires the input value to be a string, so convert
it before calling the textParsers
the same problem exists in test/integration/connection/query-test
so that there also need to be a String call
native bindings need to get the textParsers with the new syntax
queries like {text: ""} did not get recognized correctly before and
get converted to {text: {text: ""}}
if connection is created with config.binary = true, all queries get
executed with binary result unless explicit disabled with binary = false
WARNING: bigint support is not correctly working for really big
values. If the value of a integer gets big the number gets fuzzy in
javascript. This is not a limitation of this library.

If you want to handle bigint with the exact value, get it as string
and do not calculate things with it!
instead of the connection string use the config dict in all tests to
be able to specify things like binary mode
integration tests could now be started in binary mode
some tests are executed in text mode anyway, they are currently not
compatible with binary mode or prepared statements at all
(f.e. multiple statements in one query)
@AlexanderS
Copy link
Contributor Author

Changed a lot of stuff. All tests pass now. I also added a possibility to run the integration tests in binary mode.

Hope you like it. :)

@brianc brianc merged commit b2a2d02 into brianc:master Nov 28, 2011
@brianc
Copy link
Owner

brianc commented Nov 28, 2011

awesome work. thank you!

brianc pushed a commit that referenced this pull request Apr 28, 2020
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