Skip to content
On this page

Database

Module to generate database related entries.

collation

Returns a random database collation.

Available since v4.0.0

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.

Available since v4.0.0

Returns: string

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

engine

Returns a random database engine.

Available since v4.0.0

Returns: string

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

mongodbObjectId

Returns a MongoDB ObjectId string.

Available since v6.2.0

Returns: string

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

type

Returns a random database column type.

Available since v4.0.0

Returns: string

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

Released under the MIT License.