2017 © Pedro Peláez
 

libray seeder

seeds database based on information scheme

image

seedatlas/seeder

seeds database based on information scheme

  • Wednesday, April 25, 2018
  • by JethroT83
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

BASIC USAGE, (*1)

records(2)->seed()->getSeedData(); ?>

setConnection -- this library has to talk to the database. This function sets a static binding that will call the database, (*2)

Table -- sets the table that will get seeded, (*3)

records -- the number of record seeded, (*4)

seed -- seeds the records, (*5)

getSeedData -- returns the seeded data, (*6)

$data should return an array of all the values seeded in the database, (*7)

ENTERING PARAMETERS params([ ["user_id"=>1, "user_name"=>"John Doe"], ["user_id"=>2, "user_name"=>"Jane Doe"], ])->records(20) ->seed() ->getSeedData(); ?>, (*8)

params -- params is a 2 dimensional array. The first dimension is a numeric index that represents each row. The second dimension has an associative key will match a column name. Simply match each column name and set it to the value you want., (*9)

records -- There will still be 20 records seeded, but the first two will reflec the information in the params., (*10)

ENTERING PARAMETERS WITH NO RECORDS params([ ["user_id"=>1, "user_name"=>"John Doe"], ["user_id"=>2, "user_name"=>"Jane Doe"], ])->seed() ->getSeedData(); ?>, (*11)

records and params -- when params are set and not records, there will only be as many records as set in the params., (*12)

ENTERING NO PARAMS AND NO RECORDS seed() ->getSeedData(); ?>, (*13)

This will cause the function to opt out. You must have either records or params set., (*14)

NULLABLE FIELDS params([ ["user_id"=>1, "user_name"=>"John Doe"], ["user_id"=>2, "user_name"=>"Jane Doe"], ]) ->seedNullable(true) ->seed() ->getSeedData(); ?>, (*15)

By default, this will not seed nullable fields. Setting it to true will seed the nullable fields., (*16)

The Versions

25/04 2018

dev-master

9999999-dev

seeds database based on information scheme

  Sources   Download

MIT

The Development Requires

by Jed Lynch