https://github.com/kekland/lapisdb
A modern, easy-to-use and feature-rich TypeScript embedded database.
https://github.com/kekland/lapisdb
database db embeddable embedded-database typescript
Last synced: 7 months ago
JSON representation
A modern, easy-to-use and feature-rich TypeScript embedded database.
- Host: GitHub
- URL: https://github.com/kekland/lapisdb
- Owner: kekland
- License: mit
- Created: 2019-02-07T06:17:56.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-12T01:43:03.000Z (over 2 years ago)
- Last Synced: 2025-02-15T07:49:14.682Z (8 months ago)
- Topics: database, db, embeddable, embedded-database, typescript
- Language: TypeScript
- Homepage:
- Size: 2.61 MB
- Stars: 20
- Watchers: 2
- Forks: 0
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# 💥 LapisDB
[](https://github.com/kekland/lapisdb)
[](https://github.com/kekland/lapisdb/fork)
[](https://github.com/kekland/lapisdb)
[](https://www.npmjs.com/package/lapisdb)
[](https://www.npmjs.com/package/lapisdb)
[](https://travis-ci.org/kekland/lapisdb)
[](https://www.codacy.com/app/kekland/lapisdb?utm_source=github.com&utm_medium=referral&utm_content=kekland/lapisdb&utm_campaign=Badge_Grade)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](https://github.com/kekland/lapisdb-example).
```ts
const adapter = new LevelDbAdapter(News, { name: 'news', directory: './database' })
const db = new Datastore('news', adapter)
DatastoreManager.register(db)export class News extends Model {
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 = 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!
```bash
cd my-awesome-project
npm install --save lapisdb
```[**Download via NPM**](https://npmjs.com/package/lapisdb)
## How do I use it?
### 📋 Tutorial
Check out the **GitHub Wiki** page [here](https://github.com/kekland/lapisdb/wiki).
### 📕 Documentation
You can find the full **TypeDoc documentation** [here](https://kekland.github.io/lapisdb) (not updated as of v0.3.0).
## Plugins, additional features
- [LapisDB observatory](https://github.com/kekland/lapisdb_observatory)
- [LevelDB adapter](https://github.com/kekland/lapisdb-level-adapter)
## Contact me
**E-Mail**: `kk.erzhan@gmail.com`