Bone

Bone

Public base class for Leoric models.

Extend this class to define a model, then use its static query and persistence methods or instantiate it to work with a single record.

Constructor

new Bone()

Example:
class Post extends Bone {}
Post.init({ title: DataTypes.STRING });
const post = await Post.create({ title: 'Leoric' });

Members

(static) unscoped

Discard all the applied scopes. Bone.unscoped includes soft-deleted rows

Methods

create(opts)

create instance

Parameters:
Name Type Description
opts

query options

(async) update(changes, opts)

update rows

Parameters:
Name Type Description
changes

data changes

opts

query options