Skip to content

bailmast/gm-sickql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 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, err = SickQL.New({
  Driver = 'tmysql', -- either sqlite, tmysql or mysqloo
  Hostname = 'localhost',
  Port = 3306,
  Username = 'root',
  Password = 'root',
  Database = 'sys',
})

if err ~= nil then
  print('Connection failed: ' .. err)
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)