
💽 DB Faker
DB Faker is a CLI to easily dump your production databases for development ones.
- 📚 Sample your production to avoid filling your disk !
- 🕵 Anonymize your dumps to avoid exposing sensible data !
🚧 This library is under heavy development 🚧
Use it at your own risks !
Help us to make this library Production ready by Contributing.
📅 Roadmap
CLI
Install
npm install -g @db-faker/cli
$ npm install pg
$ npm install pg-native
$ npm install sqlite3
$ npm install better-sqlite3
$ npm install mysql
$ npm install mysql2
$ npm install oracledb
$ npm install tedious
Configure
source:
connection:
client: 'pg'
connection: postgres://root:root@localhost:5432/public
dumper:
tables:
- name: users
subset:
limit: 1000
relations:
- name: profiles
from: id
to: user_id
relations:
- name: accounts
from: id
to: user_id
- name: products
subset:
limit: 100
anonymizer:
tables:
- name: users
columns:
- name: firstname
engine: name.firstName
- name: lastname
engine: name.lastName
columns:
- name: email
engine: internet.email
dumpDirectory: tmp
anonymizedDirectory: tmp/anonymized
Library
WIP
👀 Looking for more
If you only want to sample your database, you can directly use Dumper.
And if you only want to anonymize your data, you can use Anonymizer
WIP