# forgebase

> ForgeBase is a Nodejs library that allows you to use very flexible relationships and properties in a database without the need for a schema.

Latest version **1.0.2** (published 2024-02-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install forgebase
pnpm add forgebase
yarn add forgebase
bun add forgebase
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2024-02-29 |
| First published | 2024-02-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 16.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | devho |
| Maintainers | devho |
| Keywords | database, sqlite, nodejs, javascript, forgebase, forge, base, flexible, relationships, properties, schema, nosql, nosql-database, nosql-databases, nosql-database-management, nosql-database-management-system, nosql-database-management-systems, nosql-database-system, nosql-database-systems, nosql-databases-system, nosql-databases-systems, nosql-database-system-management, nosql-database-system-managements, nosql-database-systems-management, nosql |

## Links

- npm: https://www.npmjs.com/package/forgebase
- npm.io page: https://npm.io/package/forgebase

## Dependencies (2)

- [uuid](https://npm.io/package/uuid.md) ^9.0.1
- [sqlite3](https://npm.io/package/sqlite3.md) ^5.1.7

## Alternatives

- [@libsql/sqlite3](https://npm.io/package/@libsql/sqlite3.md) — 39.8K weekly downloads
- [@fortemi/core](https://npm.io/package/@fortemi/core.md) — 461 weekly downloads
- [cdb-converter](https://npm.io/package/cdb-converter.md) — 341 weekly downloads
- [@uplo/adapter-prisma](https://npm.io/package/@uplo/adapter-prisma.md) — 75 weekly downloads
- [typeorm-aios](https://npm.io/package/typeorm-aios.md) — 30 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2024-02-29
- 1.0.1 — 2024-02-29
- 1.0.0 — 2024-02-29

## README

# Hello forgebase!

`ForgeBase` is a very simple local database management library that utilizes three main tables - Entity, Attribute, and Relationship - to create a flexible database structure. This gives it the ability to easily adapt to different types of data and rapidly changing data models.

# Dev's Note

We still have a lot of work to do, and we'd love to see more `pull requests`. Please visit my [GitHub](https://github.com/velo1203/ForgeBase), following helps.

# Start the installation.

```javascript
npm install forgebase
```

# Create a new database.

```javascript
const forgebase = require("forgebase");
const db = new forgebase("./database.db");
```

The code above loads forgebase and sets the database address for forgebase. forgebase is a local database.

# Create Reference

```javascript
const reference = db.setReference("iphone");
```

First, let's create a reference named user. The create read update delete operations that occur on a user reference will work with respect to the entity named user.

# Create a new entity.

```javascript
reference.create({ name: "devho", age: 17 });
```

The above code will create an entity named user with the name dev and an age of 17.

Thinking more deeply, forgebase's storage method stores entities and attributes in separate tables and rows: age is an attribute and 17 is the value of that attribute, creating an attribute for the center entity.

# Read an entity.

```javascript
reference.get({ name: "devho" });
```

The above code will list a list of entities with the name devho.

```javascript
reference.getAll();
```

You can also get all entities in that reference.

# Update an entity.

```javascript
reference.update({ name: "devho" }, { age: 18 });
```

`targetQuery`, `updateQuery` : parameter of `update` method.

The above code will update the age of the entity with the name devho to 18.

# Delete an entity.

```javascript
reference.delete({ name: "devho" });
```

The above code will delete the entity with the name devho.

---
_Source: https://npm.io/package/forgebase · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
