harnessflex / persona

A Laravel inspired ORM for Harness. Built on top of Bookshelf and Knex.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Harness Persona

A Laravel inspired ORM for Harness. Built on top of Bookshelf and Knex.

Install

This package is automatically installed with the Harness Flex Framework.

npm i @harnessflex/persona

Basic Usage

Creating a model

import { Model } from '@harnessflex/persona'

class User < Model

    # The attributes that should be hidden for arrays.
    #
    # @type {string[]}

    get hidden
        [
            'password'
            'remember_token'
        ]

Accessing the model

...

# Find first user...

User.find(1).then do(user)

    console.log user

Visit https://bookshelfjs.org/ for more information.

Using the DB class

import { DB } from '@harnessflex/persona'

DB.table('users').where('id', 1).first().then do(user)

    console.log user

Visit https://knexjs.org/ for more information.

Security

If you discover any security related issues, please email donaldpakkies@gmail.com instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

About

A Laravel inspired ORM for Harness. Built on top of Bookshelf and Knex.

License:MIT License


Languages

Language:JavaScript 100.0%