- Documentation
- Database
Category
Database
All Lua functions and events in the Database category, on the server and the client.
Server functions 9
dbOpens a connection to an SQLite database (a file in the resource folder) or MySQL.Connect dbRuns a query that returns no result (INSERT, UPDATE, CREATE). Arguments replace theExec ?placeholders.dbRuns a query and returns its result right away. One call instead ofFetch dbQuery,dbPollanddbFree. Works with SELECT, INSERT, UPDATE and DELETE.dbRuns a query and returns only the first row. Handy when you look for a single record, for example a player's account.Fetch One dbRuns a query and returns a single value: the first column of the first row. For counting (Fetch Value COUNT(*)), sums and single fields.dbFrees a query result you do not intend to read.Free dbCollects the result of aPoll dbQuery: the rows, the number of affected rows and the last inserted ID. If you just want to run a query and get the rows,dbFetchis simpler.dbReturns the query text with values placed atPrepare String ?and safely quoted. Useful when building a larger query from parts.dbSends a query that returns a result. Collect it withQuery dbPollor in a callback that receives the query handle.