The SPOD

SPOD stands for Simple Persistence Objects Database. It is a functionality of the library to allow one to define objects in haXe and save and retrieve them easily from a database.

In fact, you will need to map haXe classes to tables in your database and you will be able to insert new records, delete them, update them, and search them.

Setting a SPOD object

To create objects that you will be able to use as SPOD objects, you have to create a class that extends neko.db.Object or php.db.Object.

Simply create the fields that exist in your table in the class as you would normally do:

class User extends neko.db.Object
{
   public var id : Int;
   public var userName : String;
   public var password : String;
}

We will also need to define a manager; it will ...

Get haXe 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.