New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mysql-faker

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mysql-faker

A simple use of faker.js to populate MySQL database tables

0.0.2
Source
npm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

MySQL Faker

This module uses the excellent faker.js to easily generate data to populate MySQL database with fake data. For now, the module assumes that all tables already exist. To start, create an instance of the Table class giving a name and the number of entities to generate. Faker types can then be chained on this class to add columns to the database. All types are functions on the Table class with an underscore character between the type category and name. For example, faker.name.firstName() is equivalent to table.name_firstName. The first parameter to the type is the name of the column and any additional parameters are passed on to faker.

Example

var mysql_faker = require('mysql-faker');

var users = (new mysql_faker.Table('users', 1000000));
users.name_firstName('firstname')
     .name_lastName('lastname')

mysql_faker.insert([users]);

FAQs

Package last updated on 12 Jan 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts