Skip to content
This repository has been archived by the owner on Nov 16, 2017. It is now read-only.

Introduction

stickupkid edited this page Aug 1, 2011 · 1 revision

Open a database:


const resouce : File = File.applicationStorageDirectory.resolvePath('session.db');

const manager : SpodManager = new SpodManager();
manager.open(resource, true);

Create a table of Users:


const database : SpodDatabase = maganger.database;
database.createTable(User);

Insert a new User:


const table : SpodTable = database.getTable(User);
const user : User = new User('Fred', 28);
table.insert(user);

Update a User with a new age (getting old!):


user.age = 29;
user.update();

Delete a User:


user.remove();

Sync a User with a database in case some other program is editing the db:


user.sync();

There’s much more, if you want to help then get forking and send pull requests.

Clone this wiki locally