Database
Database class is used to access SQLite database. To use Database class, you need to add (inscribe) the sqlite into Uses textbox in project preferences window.

It creates access to the local database file and provides basic operations like open, close and exec. The last inserted ID from tables with auto incremented ID is obtained by lastInsertedID.
Example:
Let’s create a simple database using Moscrif IDE. The name of the database is "test", and it contains one table called "users". ID as Primary key, firstName, LastName and Birth can be found in the table.
Step one is to create a new database. For this example, we can create a new project database-example. Right click on the project and choose new File, then pick SQLite database file (.db) :

Step Two is to create table users with userID, firstName, lastName and birthDate. Double click on test.db file and click on Add Table button.

Step three is insertion into the table. Let’s insert John Smith into users table. Click on Sql and paste following SQL command into SQL String and then press Execute Query button.
insert into users (userID,firstName,lastName) values (null,"John","Smith");
Database, table and data are created with everything prepared for your source code in your project. Following example shows how to open test.db database and retrieve data stored in users table.
//open database socket
var database = Database.open("app://test.db");
//create SQL query
var result = database.exec("select * from users");
//release sources reserved for database
database.close();
The result of this code is an instance of Dataset class. To find more info about Dataset class, please see Dataset documentation.