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

I can't add in false values in an insert statement #93

Closed
Joematpal opened this issue Sep 27, 2023 · 6 comments
Closed

I can't add in false values in an insert statement #93

Joematpal opened this issue Sep 27, 2023 · 6 comments

Comments

@Joematpal
Copy link
Contributor

I use this with sqlx primarily the "NamedExec" func. I can't insert false values into the db. It throws a syntax error.

I can enter in a true value. The "empty" value for a boolean is false. When a struct has an empty bool I can't add that value to the db.

#92

@Joematpal Joematpal changed the title I can add in false values in an insert statement I can't add in false values in an insert statement Sep 28, 2023
@Joematpal
Copy link
Contributor Author

@proullon

The tests don't actually test putting in a false to the db.

The tests also don't regularly test the argument substitution.

The test and package don't treat the order of the argument substitution like other sql packages do. This package wants the order to be that of the order of the statements in the create statement. Not of the sql statement you want to execute.

@proullon
Copy link
Owner

proullon commented Oct 5, 2023

Hi,

Thanks for reporting, this is really strange. I'll take a look

@proullon
Copy link
Owner

proullon commented Oct 5, 2023

Ok so db.Exec("INSERT INTO cat (breed, name, funny) VALUES ('indeterminate', 'Uhura', false)") is enough to trigger the syntax error. I'll update the parser

@proullon
Copy link
Owner

proullon commented Oct 5, 2023

Can you check @v0.1.3 ?

@Joematpal
Copy link
Contributor Author

Yes there is also an issue with the order of the arguments that get passed in. The substitutions really need to be used more in the tests.

@proullon
Copy link
Owner

proullon commented Oct 5, 2023

I'm sorry, I don't understand. Can you give me an example ?

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

2 participants