UNPKG

1.34 kBJavaScriptView Raw
1/**
2 *
3 * @namespace faker.database
4 */
5var Database = function (faker) {
6 var self = this;
7 /**
8 * column
9 *
10 * @method faker.database.column
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 * type
23 *
24 * @method faker.database.type
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 * collation
37 *
38 * @method faker.database.collation
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 * engine
51 *
52 * @method faker.database.engine
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
64module["exports"] = Database;