Mukul Latiyan has Published 474 Articles

How to work with MySQL in Lua Programming?

Mukul Latiyan

Mukul Latiyan

Updated on 20-Jul-2021 13:36:12

1K+ Views

Lua provides different libraries that once can be used to work with MySQL. The most popular framework that enables us to work with MySQL in Lua is LuaSQL.LuaSQL is a simple interface from Lua to a DBMS. It enables a Lua program to −Connect to ODBC, ADO, Oracle, MySQL, SQLite, ... Read More

How to use the Time package in Lua programming?

Mukul Latiyan

Mukul Latiyan

Updated on 20-Jul-2021 13:32:40

2K+ Views

Lua library provides us with a time package that can be used to calculate the current time and that current time can be converted into hours, days and minutes and we can also take the later values and turn them into a Lua representation of time.In order to make use ... Read More

How to use the require function in Lua programming?

Mukul Latiyan

Mukul Latiyan

Updated on 20-Jul-2021 13:31:18

8K+ Views

Lua offers a high-level function which we can use when we want to load and run libraries. This high-level function is named require function.The require function mainly targets the high level functions and keywords.The require function is a bit similar to the dofile function, but it has two key differences, ... Read More

How to Use the Remove function in Lua programming?

Mukul Latiyan

Mukul Latiyan

Updated on 20-Jul-2021 13:29:43

1K+ Views

There are cases when we want to remove an element from a table. In Lua, the table library provides functions to remove elements from the table.The remove function usually takes two arguments, the first argument is usually the name of the table from which we want to remove the element ... Read More

How to use the Insert function in Lua Programming?

Mukul Latiyan

Mukul Latiyan

Updated on 20-Jul-2021 13:27:53

4K+ Views

There are cases when we want to insert elements into a table. In Lua, the table library provides functions to insert elements into the table.The insert function usually takes two arguments, the first argument is usually the name of the table from which we want to insert the element to, ... Read More

How to Use lua-mongo library in Lua Programming?

Mukul Latiyan

Mukul Latiyan

Updated on 20-Jul-2021 13:26:10

659 Views

Lua provides different libraries that can be used to work with MongoDB. The most popular framework that enables us to work with MongoDB in Lua is lua-mongo.Lua-mongo is a binding to MongoDB C Driver for Lua −It provides a Unified API for MongoDB commands, CRUD operations and GridFS in MongoDB ... Read More

How to use Lua Programming to check if a file exists?

Mukul Latiyan

Mukul Latiyan

Updated on 20-Jul-2021 13:24:28

2K+ Views

Lua provides us with different functions and methods that we can use when we want to work with files. These methods or functions do different operations, like from opening a file, to closing a file, to opening a file with a specific mode also.While many of these functions that Lua ... Read More

How to split a string in Lua programming?

Mukul Latiyan

Mukul Latiyan

Updated on 20-Jul-2021 13:23:01

15K+ Views

Splitting a string is the process in which we pass a regular expression or pattern with which one can split a given string into different parts.In Lua, there is no split function that is present inside the standard library but we can make use of other functions to do the ... Read More

How to search for an item in a Lua List?

Mukul Latiyan

Mukul Latiyan

Updated on 20-Jul-2021 13:20:38

2K+ Views

When we want to iterate over an item to find a specific value we usually make use of the for loop. It’s always the most intuitive approach and it is a recommended one.Let’s explore an example where we have a list of fruits stored in Lua, and then we want ... Read More

How to remove Lua table entry by its key?

Mukul Latiyan

Mukul Latiyan

Updated on 20-Jul-2021 13:17:54

5K+ Views

Let’s consider an example where we would like to remove a Lua table entry. The table itself behaves like a hashmap, where it has several key value pairs, and we would like to remove an entry from that table on the basis of the key.Lua library does provide a function ... Read More

Advertisements