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

Preserve nil <-> NULL between Nimrod and database. #1497

Merged
merged 8 commits into from Oct 25, 2014

Conversation

milosn
Copy link
Contributor

@milosn milosn commented Aug 20, 2014

This is few simple tweaks to db_mysql that I needed. Not sure you want this kind of behaviour where NULL is converted to nil and nil to NULL ... in my mind thats logical.

@reactormonk
Copy link
Contributor

Why is NULL in SQL different from nil in nimrod?

@milosn
Copy link
Contributor Author

milosn commented Aug 20, 2014

Thats the wrong question ... I was doing this little ORM project for work in Nimrod and discovered that db_mysql is broken basically ... This patch fixes the breakage and decides that NULL from the database will be represented as nil when db_mysql returns the record set. Also it decides that if nil is passed in for UPDATEs and INSERTs it will insert NULL into the DB. I am just asking if my logic is correct and thats how it should be?

I have higher level code which reads table descriptions and converts string values and nil-s that db_mysql with this patch returns into ints, floats and strings(keep as it is).

@milosn
Copy link
Contributor Author

milosn commented Sep 16, 2014

Hi guys, is this any closer to getting merged? Just asking because I have nimrod RPM which i am building weekly and this is an extra patch which needs to be maintained.

@dom96
Copy link
Contributor

dom96 commented Sep 16, 2014

@Araq What do you think?

@dom96
Copy link
Contributor

dom96 commented Sep 16, 2014

@Araq gave the ok on IRC.

But before I merge this I think the changes need to be replicated for the other db* modules. Could you do that? And also add some documentation to dbQuote?

@milosn
Copy link
Contributor Author

milosn commented Sep 16, 2014

Yes i think so, i have postgres install in some VM someplace ... Ill have a look.

Varriount added a commit that referenced this pull request Oct 25, 2014
Preserve nil <-> NULL between Nimrod and database.
@Varriount Varriount merged commit d482051 into nim-lang:devel Oct 25, 2014
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.

None yet

4 participants