0.2.4 • Published 6 months ago

@rattus-orm/local-storage v0.2.4

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

localStorage data provider and helpers for Rattus ORM

Contents

  1. LocalStorageDataProvider

Installation

Use your favorite package manager. For example, yarn:

yarn add @rattus-orm/core @rattus-orm/local-storage

Basic usage

import { createDatabase, Model, Uid, Str } from '@rattus-orm/core'
import { LocalStorageDataProvider } from '@rattus-orm/local-storage'

class User extends Model {
  public static entity = 'user'
  
  @Uid()
  public id: string
  
  @Str()
  public email: string
}

const database = createDatabase({
  connection: 'entities',
  dataProvider: new LocalStorageDataProvider()
}).start()

const userRepo = database.getRepository(User)
userRepo.save([{ id: '1', email: 'test@test.com' }, { id: '2', email: 'test2@test.com' }])

const found = userRepo.find('2')

Documentation

For detailed docs please read documentation website.

Contributing

Contributions are welcome! Please read our Contributing Guide for details on our code of conduct, and the process for submitting pull requests.

0.2.3

9 months ago

0.2.4

6 months ago

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago