---
# System prepended metadata

title: Arweave ORM

---

# Arweave ORM

## Features of arweave ORM

- Create transaction(s)
- update transaction(s)
- delete transaction(s)
- fetch / get transaction(s)


### Create transaction(s)

To create a data in a typical ORM like mongoose or Sequelize, a schema would be defined.

eg. 

```javascript=
const userSchma = new Schema({
    name: {
        type: String
    },
    email: {
        type: String
    }
});
```

But for a blockchain network that's based on transactions, We would need to create multiple transactions on creation of a model instance.

for example,

```javascript=
const user = new User({
    name: 'fuad',
    email: 'fuadolatunji@potato.com'
});
```

Doing this should create an arbundle of many transactions, or is there another way?

or also it can be shrinked into just one transaction but storing the data as a string and setting the content type to something like 'application/arweave-orm' I guess.


### Update transaction(s)

Since a transaction can not be deleted from the blockchain network. we can clone the transaction with the supplied id and then create a new one with the updated fields.

eg.
Doing something like
```javascript=
await User.updateOne({
    email: 'fuad@potato.com'
},{
    name: 'BAnana'
})
```
should create a new transaction off the current transaction with that email and then set the **_id** of the new transaction to _id of the previous transaction. and also something like and __v or something just to know the current data. and not get old data when fetching data.


### Delete transaction(s)

For deletion of transactions we can do something like adding as isDeleted field or semething to the model. Just the basic soft delete analogy since data can't be deleted from the blockchain network.

# NB:
How would all this be possible??

Let's brainstorm. that's all I can think of currently. and also there are aggregations and more in orms. how do we implement those.?