Garry's Mod database interface that supports SQLite, TMySQL & MySQLOO.
-- connection using any driver is thread-blocking
local connection, error = SickQL.New({
Driver = 'tmysql', -- either sqlite, tmysql or mysqloo
Hostname = 'localhost',
Port = 3306,
Username = 'root',
Password = 'root',
Database = 'sys',
})
if error ~= nil then
print('Connection failed: ' .. error)
end
print('Database is connected!')
connection:Query('select version()', function(data)
print('Database version is ' .. data[1]['version()'])
end, function(why)
print('Failed to get version from query: ' .. why)
end)