Crates.io | spawnflake |
lib.rs | spawnflake |
version | 0.2.8 |
source | src |
created_at | 2021-05-20 00:31:57.301625 |
updated_at | 2024-04-03 10:20:25.027989 |
description | Generate pattern based random data for mysql |
homepage | |
repository | https://github.com/elasticrash/spawnflake |
max_upload_size | |
id | 399791 |
size | 94,186 |
Spawnflake is a schema agnostic, random and/or patterns based data generator, for MySQL databases.
See CHANGELOG for updates and new features.
This library works by providing a configuration file (config.json). The configuration is divided into two sections.
"mysql_configuration": {
"address": "localhost",
"port": 3306,
"user": "local",
"password": "password",
"schema": "test"
}
"types": {
"string": [
{
"name": "column_name",
"rules": []
}
],
"integer": [
{
"name": "column_name",
"rules":[]
}
],
"float": [
{
"name": "column_name",
"rules":[]
}
]
}
"rules": [
[
"Jo",
"Ni",
"Ste",
"Da",
"Sco",
"Ma"
],
[
"ve",
"vi",
"pha",
"ro",
"na",
"ri"
],
[
"n",
"ck",
"tt",
"d",
"than",
"na"
]
]
This could create real names like David
but also complete random combinations like Jophack
Datastore | Data type | Random | Pattern |
---|---|---|---|
Mysql | varchar | ✔️ | ✔️ |
Mysql | int | ✔️ | ✔️ |
Mysql | unsigned int | ✔️ | ✔️ |
Mysql | smallint | ✔️ | ✔️ |
Mysql | unsigned smallint | ✔️ | ✔️ |
Mysql | tinyint/unsigned tinyint | ✔️ | ✔️ |
Mysql | mediumint | ✔️ | ✔️ |
Mysql | bigint | ✔️ | ✔️ |
Mysql | unsigned bigint | ✔️ | ✔️ |
Mysql | decimal | ✔️ | ✔️ |
Mysql | float | ✔️ | ✔️ |
Mysql | double | ✔️ | ✔️ |
Mysql | bit | ✔️ | ❌ |
Mysql | time | ✔️ | ✔️ |
Mysql | timestamp | ✔️ | ✔️ |
Mysql | date | ✔️ | ✔️ |
Mysql | year | ✔️ | ❌ |
Mysql | char | ✔️ | ❌ |
Mysql | binary | ✔️ | ❌ |
Mysql | text | ✔️ | ❌ |
Mysql | longtext | ✔️ | ❌ |
Mysql | blob/longblob | ✔️ | ❌ |
Mysql | enum | ❌ | ✔️ |
The main project in this repository is a library, but there is also a CLI version available published in crates.io.
The code for the CLI is available at ./cli
. Check README for usage and more information.
Running the example requires running docker-compose
inside the test
folder. Make sure you have
To run the example execute
cargo run --example generate_mysql
You are more than welcome. All you need to do is a pull request