Open an SQLite database file and return a handle to the database. If the file does not exist, it will be created for you.
db = sqlite.open("mydatabase.db");
Close an opened SQLite database.
sqlite.close(db);
Run a query on an opened SQLite database. Returns a
db = sqlite.open("examples.db");
results = sqlite.execute(db, "SELECT * from `people`");
print("Results:\nID\tFirst Name\tLast Name");
for id,result in pairs(results) do
printf("\t%d\t%s\t%s\n", result.id, result.first_name, result.last_name);
end
Results:
ID First Name Last Name
1 John Smith
2 Jane Doe
Page last updated at 2018-09-25 20:48:36
Copyright 2024