1 |
|
2 |
|
3 |
|
4 |
|
5 | var Database = function (faker) {
|
6 | var self = this;
|
7 | |
8 |
|
9 |
|
10 |
|
11 |
|
12 | self.column = function () {
|
13 | return faker.random.arrayElement(faker.definitions.database.column);
|
14 | };
|
15 |
|
16 | self.column.schema = {
|
17 | "description": "Generates a column name.",
|
18 | "sampleResults": ["id", "title", "createdAt"]
|
19 | };
|
20 |
|
21 | |
22 |
|
23 |
|
24 |
|
25 |
|
26 | self.type = function () {
|
27 | return faker.random.arrayElement(faker.definitions.database.type);
|
28 | };
|
29 |
|
30 | self.type.schema = {
|
31 | "description": "Generates a column type.",
|
32 | "sampleResults": ["byte", "int", "varchar", "timestamp"]
|
33 | };
|
34 |
|
35 | |
36 |
|
37 |
|
38 |
|
39 |
|
40 | self.collation = function () {
|
41 | return faker.random.arrayElement(faker.definitions.database.collation);
|
42 | };
|
43 |
|
44 | self.collation.schema = {
|
45 | "description": "Generates a collation.",
|
46 | "sampleResults": ["utf8_unicode_ci", "utf8_bin"]
|
47 | };
|
48 |
|
49 | |
50 |
|
51 |
|
52 |
|
53 |
|
54 | self.engine = function () {
|
55 | return faker.random.arrayElement(faker.definitions.database.engine);
|
56 | };
|
57 |
|
58 | self.engine.schema = {
|
59 | "description": "Generates a storage engine.",
|
60 | "sampleResults": ["MyISAM", "InnoDB"]
|
61 | };
|
62 | };
|
63 |
|
64 | module["exports"] = Database;
|