Skip to content
On this page

Database

Module to generate database related entries.

collation

Returns a random database collation.

Returns: string

ts
faker.database.collation(): string
faker.database.collation() // => "ascii_bin"
faker.database.collation() // 'utf8_unicode_ci'

column

Returns a random database column name.

Returns: string

ts
faker.database.column(): string
faker.database.column() // => "category"
faker.database.column() // 'createdAt'

engine

Returns a random database engine.

Returns: string

ts
faker.database.engine(): string
faker.database.engine() // => "CSV"
faker.database.engine() // 'ARCHIVE'

mongodbObjectId

Returns a MongoDB ObjectId string.

Returns: string

ts
faker.database.mongodbObjectId(): string
faker.database.mongodbObjectId() // => "cdfcdcbc9de896d1f58abbba"
faker.database.mongodbObjectId() // 'e175cac316a79afdd0ad3afb'

type

Returns a random database column type.

Returns: string

ts
faker.database.type(): string
faker.database.type() // => "double"
faker.database.type() // 'timestamp'

Released under the MIT License.