Lua database object - VanaDev/Vana GitHub Wiki

Table of Contents

Example DB Object

 chardb = {
 	["host"] = "localhost",
 	["username"] = "abc",
 	["password"] = "def",
 	["table_prefix"] = "vana_",
 	["database"] = "vana",
 	["port"] = 33333,
 };

Properties

host

Required: Yes

Type: string (url/ipv4/ipv6?)

Notes: Describes the address where database is hosted. This is not interpreted by Vana, it's used purely for a SQL connection string. It's possible that it already supports IPv6. Verification of whether or not it works is needed.

username

Required: Yes

Type: string

Notes: Describes the credentials to access the database.

password

Required: No

Type: string

Notes: Describes the credentials to access the database. password is not required in the sense that Vana does not require the field to exist. If your SQL credentials have a password (and they should), the field must be present.

table_prefix

Required: No

Type: string

Notes: This will cause Vana to prefix all DB tables. So if Vana tried to query the characters table, the table_prefix in our example object would cause Vana to query vana_characters. This prevents conflicts with other tables if you happen to want to share a database with other tables.

database

Required: Yes

Type: string

Notes: Describes the database where the tables will be stored and queried.

port

Required: Yes

Type: uint16

Notes: Describes the port from which the SQL server is accepting connections.

⚠️ **GitHub.com Fallback** ⚠️