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

mysql wrapper doesn't support row with NULL column. #10

Open
ekarlso opened this issue Jan 2, 2015 · 12 comments
Open

mysql wrapper doesn't support row with NULL column. #10

ekarlso opened this issue Jan 2, 2015 · 12 comments

Comments

@ekarlso
Copy link

ekarlso commented Jan 2, 2015

home/karlsone/projects/nim-lang/packages/test 
@[1, mysql, aaa, mit, http://vg.no, ekarlso]
@[2, amqp, 1, MIT, http://github.com/ekarlso/nim-amqp, ekarlso@gh]
Traceback (most recent call last)
test.nim(6)              test
system.nim(1979)         $
system.nim(1961)         collectionToString
SIGSEGV: Illegal storage access. (Try to compile with -d:useSysAssert -d:useGcAssert for details.)
Error: execution of an external program failed
@dom96
Copy link
Contributor

dom96 commented Jan 3, 2015

Duplicate of nim-lang/Nim#1359 and nim-lang/Nim#1477

@dom96
Copy link
Contributor

dom96 commented Oct 22, 2016

This is IMO still an issue and since nim-lang/Nim#1477 has been closed I will reopen this. We need to figure out a way to support NULL columns in the db* modules.

@dom96 dom96 reopened this Oct 22, 2016
@ekarlso ekarlso closed this as completed Sep 12, 2017
@ekarlso ekarlso reopened this Sep 12, 2017
@dom96
Copy link
Contributor

dom96 commented Nov 28, 2017

@Araq Maybe we should change the API to use Option[T]?

@Araq
Copy link
Member

Araq commented Nov 28, 2017

No, let's add overloads that accept Json. It can be more efficient this way for integers etc. Option[T] would be Option[string] which is just as weird.

@dom96
Copy link
Contributor

dom96 commented Nov 28, 2017

Couldn't we come up with some sort of simple type-safe API using a macro? Abusing JSON for this seems odd.

@Araq
Copy link
Member

Araq commented Nov 28, 2017

Hmm, ok. So it would be varargs[typed]? Nice idea, could work.

@dom96
Copy link
Contributor

dom96 commented Nov 28, 2017

Marking as high priority so that we do this soon.

@dom96
Copy link
Contributor

dom96 commented Feb 17, 2018

This doesn't require breaking changes so I'm demoting it.

@Stuffe
Copy link

Stuffe commented Dec 1, 2019

Any suggested temporary work around to this? This has got me quite stuck at the moment

@Araq
Copy link
Member

Araq commented Dec 3, 2019

@Stuffe
Copy link

Stuffe commented Dec 4, 2019

Araq, I ended up setting the last bit in every byte to 1 and putting those lost bits in an extra byte every 8 bytes. Insanely disgusting but avoids null bytes and I had to come up with something fast

@jfilby
Copy link
Contributor

jfilby commented Dec 29, 2020

I have this problem constructing complex inserts with db_postgres. I would say the solution is to use Option[T] as it is the most straightforward and the concept of options map to null/not null quite well.

@ringabout ringabout transferred this issue from nim-lang/Nim Dec 8, 2022
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

No branches or pull requests

5 participants