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

name not taken in consideration for mysql #35

Closed
zaher-mh opened this issue Aug 16, 2017 · 3 comments
Closed

name not taken in consideration for mysql #35

zaher-mh opened this issue Aug 16, 2017 · 3 comments

Comments

@zaher-mh
Copy link

Name argument is not taken in consideration when creating mysql db.
None should replace by args.name here
https://github.com/emirozer/fake2db/blob/master/fake2db/fake2db.py#L161

@emirozer
Copy link
Owner

Thank you for the report, i will take a look at this

@bhrgu
Copy link
Contributor

bhrgu commented Aug 30, 2017

Hi, all! My two cents is that the issue reported above is not specific only for mysql.
Name argument is used only if custom argument is presented, except postgresql.
I mean if statements in fakedb.main():

if args.name and args.custom:
    fake_sqlite_handler.fake2db_sqlite_initiator(args.rows,
                                                             args.name, args.custom)
elif args.custom:
    fake_sqlite_handler.fake2db_sqlite_initiator(args.rows, None, args.custom)
else:
    fake_sqlite_handler.fake2db_sqlite_initiator(args.rows)

BTW, it looks like a lack of logic, because name argument will be checked later in database_caller_creator methods and custom argument will checked in *initiator methods.

Maybe we need refactor this behavoir for calling all initiators the way it's implemented for postgresql?
https://github.com/emirozer/fake2db/blob/master/fake2db/fake2db.py#L179

That will make code simpler and avoid excessive conditional checks.

@emirozer
Copy link
Owner

emirozer commented Feb 9, 2018

I just released version 0.5.4 to PyPi that contains this fix.

@emirozer emirozer closed this as completed Feb 9, 2018
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

3 participants