dev-master
9999999-devseeds database based on information scheme
MIT
The Development Requires
by Jed Lynch
seeds database based on information scheme
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)
seeds database based on information scheme
MIT