Skip to content

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

License

Notifications You must be signed in to change notification settings

harnessflex/persona

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published