0.4.4 • Published 5 years ago

lapisdb v0.4.4

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

💥 LapisDB

star this repo fork this repo License Version Downloads Status Codacy Badge

A TypeScript embedded database that is really easy and nice to use.

Attention

I am still working on this project, and many things might change in future.

Example

You can check out a full REST API here.

const adapter = new LevelDbAdapter(News, { name: 'news', directory: './database' })
const db = new Datastore('news', adapter)
DatastoreManager.register(db)

export class News extends Model<News> {
  body: string;
  author: string;

  constructor(body: string, author: string) {
    super(News)

    this.body = body
    this.author = author
  }
}

// Getting items
const items: News[] = await db.getItems()

// Filtering results
const items: News[] = await db.getItems((n) => n.author === 'kekland')

// Getting single item
const item: News = await db.get('identifier')

// Getting single item through its parameters
const item: News = await db.get({author: 'kekland'})

// Adding an item
const newItem: News = await new News('interesting body', 'kekland').save()

// Editing an item
newItem.body = 'a more interesting body'
await newItem.save()

// Getting a reference to an item
const reference: Reference<News> = newItem.getReference()

// Getting an item through its reference
console.log((await reference.get(News)) === newItem) // true

// Deleting an item
await newItem.delete()

Why?

During my experience writing servers, I often cannot find a database that is both fast and easy to use.

LapisDB tries to solve this problem. It is fully typed and uses TypeScript to make the development process a blast.

Try it out!

cd my-awesome-project
npm install --save lapisdb

Download via NPM

How do I use it?

📋 Tutorial

Check out the GitHub Wiki page here.

📕 Documentation

You can find the full TypeDoc documentation here (not updated as of v0.3.0).

Plugins, additional features

Contact me

E-Mail: kk.erzhan@gmail.com

0.4.4

5 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago