Database

SERVER SIDE ONLY

Functions

generate_unique_id

Use the following to generate a unique id by checking against a database table.

--- Specify prefix
local prefix = 'boii_'
--- Specify length of random string to attach to prefix
local length = 5
--- Specify database table name
local table_name = 'players'
--- Specify table column name
local column_name = 'metadata'
--- Specify a json path if required *Optional*
local json_path = 'bank_account'

--- Utils object
utils.db.generate_unique_id(prefix, length, table_name, column_name, json_path)

--- Output: 'boii_12345'

--- Direct export
exports.boii_utils:generate_unique_id(prefix, length, table_name, column_name, json_path)

Last updated