Skip to content

bailmast/gm-sickql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

SickQL

Garry's Mod database interface that supports SQLite, TMySQL & MySQLOO.

Usage

-- 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)