You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found myself needing to do the following to replicate a table structure:
fake2db --rows 1500 --db mysql --name=test_speed --username root --password secret --custom date_time_this_year random_digit_not_null random_digit_not_null uuid4 word boolean boolean boolean random_number random_number word last_name word word word word last_name year
Then I found out that I couldn't use duplicate faker keys for my columns, so using random_digit_not_null twice is not possible.
I wrote some code in the mysql handler to append keys to the columns in order to allow duplicates (see this commit denitsa-md@73df919)
I do think the mysql_handler is probably not the best place for this -> the unique columns should somehow be formatted further up and passed to all handlers. But it's the first time I'm touching python so I just hacked it a bit for my purposes.
Then the command above would result in a table structure like this:
Would be nice if something like this was supported out of the box for all database engines. Or perhaps even better, the option to name the columns in addition to providing the faker keys. This would alleviate the issue altogether.
The text was updated successfully, but these errors were encountered:
I found myself needing to do the following to replicate a table structure:
Then I found out that I couldn't use duplicate faker keys for my columns, so using
random_digit_not_null
twice is not possible.I wrote some code in the mysql handler to append keys to the columns in order to allow duplicates (see this commit denitsa-md@73df919)
I do think the
mysql_handler
is probably not the best place for this -> the unique columns should somehow be formatted further up and passed to all handlers. But it's the first time I'm touching python so I just hacked it a bit for my purposes.Then the command above would result in a table structure like this:
Would be nice if something like this was supported out of the box for all database engines. Or perhaps even better, the option to name the columns in addition to providing the faker keys. This would alleviate the issue altogether.
The text was updated successfully, but these errors were encountered: