<img src="https://i.imgur.com/8gklsYC.png" width="200">

# 📊 HosounSQL
> *Yet another sql-based ODM to model your data in objects, written in fresh and pure JavaScript*

## Why we wrote Hosoun?
We needed a fast and reliable ODM capable to work with SQL, but these were very 
difficult to understand, and we wanted a simpler ODM. That's we wrote HosounSQL.

## Installation
Simply do in your console:
```bash
$ npm install hosoun --save
```

## Usage
Here is an example to understand how HosounSQL works:
```js
const hosoun = require('hosoun')

const db = new hosoun.Cluster({
    poolName: 'myPool'
})

db.query({
    type: 'CREATE TABLE',
    documentName: 'mydb',
    tableName: 'mytable',
    tableSchema: ['id TEXT', 'name TEXT', 'age NUMERIC']
})

db.query({
    type: 'INSERT',
    table: 'mytable',
    tableModel: ['id', 'name', 'age'],
    values: ['1', 'Aidak', '14']
})

db.query({
    type: 'SELECT',
    table: 'mytable',
    where: {
        key: 'id',
        value: '1'
    },
    getOption: 'name'
})
```

## Contributing
You can open an issue or do a pull request to discuss it.
If you want to contribute to the project or have any question, add me on Discord: `Aidak#0001`.