1.0.8 • Published 7 years ago

ionic-sqlite-orm v1.0.8

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

ionic-sqlite-orm

This a a light-weight ORM for ionic 2 using native SQLITE plugin for cordova and WebSQL for browser support. This package is using SqlDatabase (https://github.com/mirkonasato/ionix-sqlite) as dependency. Thanks to mirkonasato for support.


Installation

npm i ionic-sqlite-orm

How to use

You need to first create a model which will extends to QueryBuilder. for example :- post.model.ts

import {BaseModel} from 'query-builder';

export class PostModel extends BaseModel {
    public database: string = 'test.db';
    public table: string = 'posts';
    public schema: Object = {
        id: 'INTEGER(11) PRIMARY KEY',
        title: 'VARCHAR(255)',
        description: 'TEXT',
        parent_category_id: 'INTEGER(11)',
        category_id: 'INTEGER(11)',
        cover: 'VARCHAR(255)',
        created_at: 'DATETIME',
        updated_at: 'DATETIME',
        status: 'INTEGER(1)'
    }
}
1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago