romanyx / Polluter
Licence: mit
The easiest solution to seed database with Go
Stars: ✭ 146
Projects that are alternatives of or similar to Polluter
Migrate
Database migrations. CLI and Golang library.
Stars: ✭ 7,712 (+5182.19%)
Mutual labels: database, mysql, postgres
Docker Backup Database
Docker image to periodically backup your database (MySQL, Postgres, or MongoDB) to S3 or local disk.
Stars: ✭ 57 (-60.96%)
Mutual labels: database, mysql, postgres
Goqu
SQL builder and query library for golang
Stars: ✭ 984 (+573.97%)
Mutual labels: database, mysql, postgres
Gnorm
A database-first code generator for any language
Stars: ✭ 415 (+184.25%)
Mutual labels: database, mysql, postgres
Zebra database
A compact, lightweight and feature-rich PHP MySQLi database wrapper
Stars: ✭ 98 (-32.88%)
Mutual labels: database, mysql, redis
Blog
Everything about database,business.(Most for PostgreSQL).
Stars: ✭ 6,330 (+4235.62%)
Mutual labels: database, mysql, postgres
Mobc
A generic connection pool for Rust with async/await support
Stars: ✭ 141 (-3.42%)
Mutual labels: database, redis, postgres
Rdbc
Rust DataBase Connectivity (RDBC) :: Common Rust API for database drivers
Stars: ✭ 328 (+124.66%)
Mutual labels: database, mysql, postgres
Prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite & MongoDB (Preview)
Stars: ✭ 18,168 (+12343.84%)
Mutual labels: database, mysql, postgres
Electrocrud
Database CRUD Application Built on Electron | MySQL, Postgres, SQLite
Stars: ✭ 1,267 (+767.81%)
Mutual labels: database, mysql, postgres
Gnomock
Test your code without writing mocks with ephemeral Docker containers 📦 Setup popular services with just a couple lines of code ⏱️ No bash, no yaml, only code 💻
Stars: ✭ 398 (+172.6%)
Mutual labels: mysql, redis, postgres
Sqlboiler
Generate a Go ORM tailored to your database schema.
Stars: ✭ 4,497 (+2980.14%)
Mutual labels: database, mysql, postgres
Metabase
The simplest, fastest way to get business intelligence and analytics to everyone in your company 😋
Stars: ✭ 26,803 (+18258.22%)
Mutual labels: database, mysql, postgres
Jet
Type safe SQL builder with code generation and automatic query result data mapping
Stars: ✭ 373 (+155.48%)
Mutual labels: database, mysql, postgres
Architect
A set of tools which enhances ORMs written in Python with more features
Stars: ✭ 320 (+119.18%)
Mutual labels: database, mysql, postgres
Crecto
Database wrapper and ORM for Crystal, inspired by Ecto
Stars: ✭ 325 (+122.6%)
Mutual labels: database, mysql, postgres
Kangaroo
SQL client and admin tool for popular databases
Stars: ✭ 127 (-13.01%)
Mutual labels: database, mysql, redis
polluter
Mainly this package was created for testing purposes, to give the ability to seed a database with records from simple .yaml files. Polluter respects the order in files, so you can handle foreign_keys just by placing them in the right order.
Usage
package main
import "github.com/romanyx/polluter"
const input = `
roles:
- name: User
users:
- name: Roman
role_id: 1
`
func TestX(t *testing.T) {
db := prepareMySQL(t)
defer db.Close()
p := polluter.New(polluter.MySQLEngine(db))
if err := p.Pollute(strings.NewReader(input)); err != nil {
t.Fatalf("failed to pollute: %s", err)
}
....
}
Examples
See examples of usage with parallel testing.
Testing
Make shure to start docker before testing.
go test
Supported databases
- MySQL
- Postgres
- Redis
Contributing
Please feel free to submit issues, fork the repository and send pull requests!
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].