| Crates.io | grow-rs |
| lib.rs | grow-rs |
| version | 2.1.1 |
| created_at | 2025-01-07 04:53:38.067673+00 |
| updated_at | 2025-09-14 00:29:13.316537+00 |
| description | 🌱 Write sedders in RON |
| homepage | https://github.com/Wilovy09/Grow-rs |
| repository | https://github.com/Wilovy09/Grow-rs |
| max_upload_size | |
| id | 1506735 |
| size | 151,653 |
Grow Seeder CLI is a command line tool written in Rust to manage database seeders. It allows to generate, list and run seeders defined in RON format for LibSQL, PostgreSQL, MySQL and SQLite compatible databases. Automatically detects the database type through the DATABASE_URL environment variable.
DATABASE_URL: Database connection URL.TURSO_AUTH_TOKEN (only for LibSQL/Turso databases).cargo install grow-rs
# or
cargo install --git https://github.com/Wilovy09/Grow-rs
| Commands | Functions |
|---|---|
| grow init | Creates a seeders/ folder in the current directory to store seeders. |
| grow new <NAME> | Creates a new .ron file inside the seeders/ folder. The file name will be <NAME>.ron. |
| grow list | Displays a list of all available seeders in the seeders/ folder. |
| grow run | Interactive mode: shows a multi-select list of all available seeders to run. |
| grow run <NAME> | Run a specific seeder (.ron extension is optional). Example: grow run roles |
| Feature | Description |
|---|---|
default |
Install libsql, sqlx databases and fake support. |
fake |
Enable fake support |
libsql |
Install only libsql support. |
sqlx |
Install only sqlx databases support. |
A seeder file in .ron format could have the following content:
[!NOTE] If the ID is generated automatically by the db, it is not necessary to enter it in the seeder.
{
// Static data
// products: DATA[(OBJECT)],
User: [
(
column_name: "value",
)
],
// Schema qualified tables
"schema.table": [
(
column_name: "value",
)
],
// Repeated data
// products(REPEATED_TIMES): {DATA},
User(4): {
"column_name": "hashed_password_admin{i}",
},
// Repeated data with schemas
// ("schema.table", REPEATED_TIMES): {DATA},
("catalogs.products", 5): {
"name": "{fake(WORD)}",
"description": "{fake(WORD)}",
"price_cents": 10000,
// "price_cents": "{fake(DIGIT)}", // THIS FAKE FEATURE IS NOT SUPPORTED
"currency": "mxn",
},
}
.env fileDATABASE_URL for Different DatabasesPostgresSQL, MySQL, SQLite (SQLx Support):
DATABASE_URL=sqlite://DB_NAME
libsql (TURSO)
DATABASE_URL=libsql://DB_NAME.turso.io
TURSO_AUTH_TOKEN=eyJhbGciWJhNGRjIn0.igV6yDaKTuDKM7_5J-UWGOftULBg
DATABASE_URL is configured to use libsql, which is a SQLite-compatible database with additional features like cloud synchronization. DB_NAME.turso.io is the URL of the database on Turso.TURSO_AUTH_TOKEN is an authentication token required to access the database on Turso.Dry-run (Simulation)
DATABASE_URL=mock://DB_NAME
/ Instead of \On operating systems like Windows, paths (file directories) are traditionally written using the backslash (). However, in the context of software development, especially when working with cross-platform tools and languages, it is common to use the forward slash (/) instead of the backslash.
DATABASE_URL=sqlite://C:\Users\User\Documents\DB_NAME
DATABASE_URL=sqlite://C:/Users/User/Documents/DB_NAME
This approach avoids compatibility issues and errors when moving code between different operating systems.
Grow Seeder CLI is compatible with:
[!NOTE] Required on all
DATABASE_URLin your.env
TURSO_AUTH_TOKEN variable.The CLI automatically detects the database type via DATABASE_URL and handles the connection appropriately.
fake in column value to create fake data.Example for fake feature:
{
User(20): {
"role": "client",
"email": "{fake(FREE_EMAIL)}",
// Templating have `i` to know the iteration
"password": "hashed_password_admin{i}",
"created_at": "2024-12-22 12:00:{mul_u32(i, 10)}",
"updated_at": "2024-12-22 12:00:{mul_u32(i, 20)}"
},
}
This project is licensed under the MIT License.