Skip to content

Alleexxi/nanos-MySQL-Wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Port of https://github.com/alexgrist/GLua-MySQL-Wrapper to https://nanos.world

Example Usage

local connection_table = {
	["db"] = "defaultdb",
	["user"] = "skibidi",
	["password"] = "skibidisigma",
	["host"] = "example.com",
	["port"] = "18114"
}

MYSQL:Connect(DatabaseEngine["MySQL"],connection_table)
MYSQL:Connect(DatabaseEngine["SQLite"])
Events.Subscribe("DatabaseConnected", function()
    local queryObj = MYSQL:Create("example");
        queryObj:Create("id", "INT NOT NULL AUTO_INCREMENT");
        queryObj:Create("name", "VARCHAR(255) NOT NULL");
        queryObj:Create("steam_id", "VARCHAR(25) NOT NULL");
        queryObj:PrimaryKey("id");
    queryObj:Execute();


	local insert = MYSQL:Insert("example")
		insert:Insert("name", "Test")
		insert:Insert("steam_id", "0120310230123")
	insert:Execute()

	local select = MYSQL:Select("example")
		select:Where("name", "Test")
	local result = select:Execute()

	print(NanosTable.Dump(result))
end)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages